diff options
author | Ken Moore <ken@pcbsd.org> | 2014-11-12 13:08:44 -0500 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2014-11-12 13:08:44 -0500 |
commit | 2b6835adff230a7cdf81983bf3fc9aa9c1b30efe (patch) | |
tree | ee225e765d2e1dbd794cd5a6b335cfcdd4b2052f /lumina-desktop/panel-plugins/desktopbar/LDeskBar.cpp | |
parent | A couple little bugfixes for lumina-fm: (diff) | |
download | lumina-2b6835adff230a7cdf81983bf3fc9aa9c1b30efe.tar.gz lumina-2b6835adff230a7cdf81983bf3fc9aa9c1b30efe.tar.bz2 lumina-2b6835adff230a7cdf81983bf3fc9aa9c1b30efe.zip |
Update the desktopbar panel plugin to recognize the alternate favorites directoryu as well as the desktop folder. Also clean up the notepad plugin appearance a bit and change the default fluxbox window theme.
Diffstat (limited to 'lumina-desktop/panel-plugins/desktopbar/LDeskBar.cpp')
-rw-r--r-- | lumina-desktop/panel-plugins/desktopbar/LDeskBar.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lumina-desktop/panel-plugins/desktopbar/LDeskBar.cpp b/lumina-desktop/panel-plugins/desktopbar/LDeskBar.cpp index c685fbc2..e60da975 100644 --- a/lumina-desktop/panel-plugins/desktopbar/LDeskBar.cpp +++ b/lumina-desktop/panel-plugins/desktopbar/LDeskBar.cpp @@ -110,10 +110,17 @@ QAction* LDeskBarPlugin::newAction(QString filepath, QString name, QIcon icon){ void LDeskBarPlugin::updateMenu(QMenu* menu, QFileInfoList files, bool trim){ menu->clear(); //re-create the menu (since it is hidden from view) + QStringList filevals; for(int i=0; i<files.length(); i++){ qDebug() << "New Menu Item:" << files[i].fileName(); if(trim){ totals.removeAll(files[i]); } - menu->addAction( newAction( files[i].canonicalFilePath(), files[i].fileName(), "") ); + filevals << files[i].fileName()+"::::"+files[i].canonicalFilePath(); + //menu->addAction( newAction( files[i].canonicalFilePath(), files[i].fileName(), "") ); + } + //Now sort the list by file name + filevals.sort(); + for(int i=0; i<filevals.length(); i++){ + menu->addAction( newAction( filevals[i].section("::::",1,1), filevals[i].section("::::",0,0), "") ); } } @@ -130,15 +137,18 @@ void LDeskBarPlugin::ActionTriggered(QAction* act){ void LDeskBarPlugin::desktopChanged(){ if(!desktopPath.isEmpty()){ QDir dir(desktopPath); + QDir favdir(QDir::homePath()+"/.lumina/favorites"); totals = dir.entryInfoList( QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot, QDir::Name); + totals << favdir.entryInfoList( QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot, QDir::Name); //Update all the special menus (trimming the totals list as we go) - updateMenu(dirM, dir.entryInfoList( QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name) ); - updateMenu(audioM, dir.entryInfoList( audioFilter, QDir::Files, QDir::Name) ); - updateMenu(videoM, dir.entryInfoList( videoFilter, QDir::Files, QDir::Name) ); - updateMenu(pictureM, dir.entryInfoList( pictureFilter, QDir::Files, QDir::Name) ); - updateMenu(docM, dir.entryInfoList( docsFilter, QDir::Files, QDir::Name) ); + updateMenu(dirM, QFileInfoList() << dir.entryInfoList( QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name) << favdir.entryInfoList( QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name)); + updateMenu(audioM, QFileInfoList() << dir.entryInfoList( audioFilter, QDir::Files, QDir::Name) << favdir.entryInfoList( audioFilter, QDir::Files, QDir::Name)); + updateMenu(videoM, QFileInfoList() << dir.entryInfoList( videoFilter, QDir::Files, QDir::Name) << favdir.entryInfoList( videoFilter, QDir::Files, QDir::Name) ); + updateMenu(pictureM, QFileInfoList() << dir.entryInfoList( pictureFilter, QDir::Files, QDir::Name) << favdir.entryInfoList( pictureFilter, QDir::Files, QDir::Name) ); + updateMenu(docM, QFileInfoList() << dir.entryInfoList( docsFilter, QDir::Files, QDir::Name) << favdir.entryInfoList( docsFilter, QDir::Files, QDir::Name) ); //Now update the launchers QFileInfoList exe = dir.entryInfoList( QStringList() << "*.desktop", QDir::Files, QDir::Name ); + exe << favdir.entryInfoList( QStringList() << "*.desktop", QDir::Files, QDir::Name ); // - Get a complete list of apps (in alphabetical order) QList<XDGDesktop> exeList; for(int i=0; i<exe.length(); i++){ |