diff settingsdialog.cpp @ 63:2340b00561d2

* Add (but don't yet use) RecentFiles class to replace inline MRU logic
author Chris Cannam
date Wed, 17 Nov 2010 14:26:27 +0000
parents f583e44d9d31
children 794db9353c7f
line wrap: on
line diff
--- a/settingsdialog.cpp	Wed Nov 17 13:32:56 2010 +0000
+++ b/settingsdialog.cpp	Wed Nov 17 14:26:27 2010 +0000
@@ -37,10 +37,11 @@
     remoteRepoLabel = new QLabel(tr("Remote repository path, e.g. http://192.168.1.10:8000/ or /home/mike/anotherrepo/ or c:\\anotherrepo\\"));
     remoteRepoCombo = new QComboBox();
     remoteRepoCombo -> insertItem(0, mainWnd->remoteRepoPath);
-    for(int i = 0; i < NUM_PATHS_IN_MRU_LIST; i++)
+/*!!!    for(int i = 0; i < NUM_PATHS_IN_MRU_LIST; i++)
     {
         remoteRepoCombo -> insertItem(i + 1, mainWnd -> remoteRepoMruList[i]);
     }
+*/
     remoteRepoCombo -> setEditable(true);
     remoteRepoLabel -> setBuddy(remoteRepoCombo);
     remoteRepoBrowseButton = new QPushButton(tr("Browse..."));
@@ -48,10 +49,11 @@
     workFolderLabel = new QLabel(tr("Local work folder path, e.g. /home/mike/work/ or c:\\mike\\work\\"));
     workFolderCombo = new QComboBox();
     workFolderCombo -> insertItem(0, mainWnd -> workFolderPath);
-    for(int i = 0; i < NUM_PATHS_IN_MRU_LIST; i++)
+/*!!!    for(int i = 0; i < NUM_PATHS_IN_MRU_LIST; i++)
     {
         workFolderCombo -> insertItem(i + 1, mainWnd -> workFolderMruList[i]);
     }
+*/
     workFolderCombo -> setEditable(true);
     workFolderLabel -> setBuddy(workFolderCombo);
     workFolderBrowseButton = new QPushButton(tr("Browse..."));
@@ -104,7 +106,7 @@
 
     if (mainWnd -> remoteRepoPath  != remoteRepoCombo-> currentText())
     {
-        insertPathToMruList(mainWnd -> remoteRepoPath, mainWnd -> remoteRepoMruList);
+//!!!        insertPathToMruList(mainWnd -> remoteRepoPath, mainWnd -> remoteRepoMruList);
         mainWnd -> remoteRepoPath = remoteRepoCombo-> currentText();
     }
 
@@ -116,7 +118,7 @@
 
     if (mainWnd -> workFolderPath != tmp)
     {
-        insertPathToMruList(mainWnd -> workFolderPath, mainWnd -> workFolderMruList);
+//!!!        insertPathToMruList(mainWnd -> workFolderPath, mainWnd -> workFolderMruList);
         mainWnd -> workFolderPath = tmp;
     }
 
@@ -154,38 +156,6 @@
     close();
 }
 
-
-void SettingsDialog::insertPathToMruList(QString path, QString mruList[])
-{
-    bool matchFound = false;
-
-    for(int i = 0; i < NUM_PATHS_IN_MRU_LIST; i++)
-    {
-        if (path == mruList[i])
-        {
-            matchFound = true;
-            break;
-        }
-    }
-
-    if (!matchFound)
-    {
-        for(int i = NUM_PATHS_IN_MRU_LIST - 2; i >= 0; i--)
-        {
-            if (i == 0)
-            {
-                mruList[1] = mruList[0];
-                mruList[0] = path;
-            }
-            else
-            {
-                mruList[i + 1] = mruList[i];
-            }
-        }
-    }
-}
-
-
 void SettingsDialog::browseDirAndSetCombo(QComboBox *combo)
 {
     QString dir;