summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 66353bb..d4351b0 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -730,98 +730,98 @@ void AdvancedFm::dirMenuSelected(int item)
}
break;
};
}
void AdvancedFm::addCustomDir()
{
Config cfg("AdvancedFm");
cfg.setGroup("Menu");
QString dir;
QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)',');
dir = CurrentDir()->canonicalPath();
bool addIt=true;
for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
{
if( dir == (*it))
{
addIt=false;
}
}
if(addIt)
{
menuButton->insertItem(dir);
// customDirMenu->insertItem(dir);
list << dir;
}
cfg.writeEntry("CustomDir", list, ',');
cfg.write();
}
void AdvancedFm::removeCustomDir()
{
// qDebug("remove custom dir");
Config cfg("AdvancedFm");
cfg.setGroup("Menu");
QString dir;
QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)',');
QStringList list2;
dir = CurrentDir()->canonicalPath();
int ramble=2;
// int ramble=-24;
//first remove list
if(list.grep(dir,true).isEmpty())
{
- QMessageBox::message("AdvancedFm",
- tr("Cannot remove current directory\nfrom bookmarks.\nIt is not bookmarked!!"));
+ QMessageBox::message(tr( "AdvancedFm" ),
+ tr("Cannot remove current directory\nfrom bookmarks.\nIt is not bookmarked!"));
}
else
{
for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
{
if((*it) != dir)//current item is not our current dir, so add it to temp list
{
list2 <<(*it);
}
else
{
// customDirMenu->removeItem( ramble);
menuButton->remove( ramble);
}
ramble++;
// ramble--;
}
cfg.writeEntry("CustomDir", list2, ',');
cfg.write();
}
// customDirsToMenu();
}
void AdvancedFm::gotoCustomDir(const QString &dir)
{
// qDebug("gotoCustomDir(const QString &dir) " +dir );
QString curDir = dir;
QDir *thisDir = CurrentDir();
// if( curDir.isEmpty()) {
// }
if( curDir == s_addBookmark)
{
addCustomDir();
}
if( curDir == s_removeBookmark)
{
removeCustomDir( );
}
else
{
if(QDir( curDir).exists() )
{
thisDir->setPath( curDir );
chdir( curDir.latin1() );
thisDir->cd( curDir, TRUE);