[Digikam-devel] extragear/graphics/digikam

Renchi Raju renchi at pooh.tam.uiuc.edu
Thu Jul 14 23:11:25 BST 2005


SVN commit 434647 by pahlibar:

reenable switching album library path.
 * move scanning/upgrading to new db into AlbumManager::setLibraryPath()

testing requested
CCMAIL: digikam-devel at kde.org


 M  +7 -0      digikam/albumfolderview.cpp  
 M  +1 -0      digikam/albumfolderview.h  
 M  +21 -0     digikam/albummanager.cpp  
 M  +2 -0      digikam/digikamapp.cpp  
 M  +0 -20     digikam/main.cpp  
 M  +0 -2      utilities/setup/setupgeneral.cpp  


--- trunk/extragear/graphics/digikam/digikam/albumfolderview.cpp #434646:434647
@@ -122,6 +122,8 @@
             SLOT(slotAlbumAdded(Album*)));
     connect(d->albumMan, SIGNAL(signalAlbumDeleted(Album*)),
             this, SLOT(slotAlbumDeleted(Album*)));    
+    connect(d->albumMan, SIGNAL(signalAlbumsCleared()),
+            SLOT(slotAlbumsCleared()));
     connect(d->albumMan, SIGNAL(signalAlbumIconChanged(Album*)),
             this, SLOT(slotAlbumIconChanged(Album*)));
 
@@ -210,6 +212,11 @@
     }
 }
 
+void AlbumFolderView::slotAlbumsCleared()
+{
+    clear();
+}
+
 void AlbumFolderView::setAlbumThumbnail(PAlbum *album)
 {
     if(!album)
--- trunk/extragear/graphics/digikam/digikam/albumfolderview.h #434646:434647
@@ -53,6 +53,7 @@
     
     void slotAlbumAdded(Album *);
     void slotAlbumDeleted(Album *album);
+    void slotAlbumsCleared();
     void slotAlbumIconChanged(Album* album);
                             
     void slotContextMenu(QListViewItem*, const QPoint&, int);
--- trunk/extragear/graphics/digikam/digikam/albummanager.cpp #434646:434647
@@ -43,6 +43,8 @@
 #include "albumitemhandler.h"
 #include "dio.h"
 #include "albumsettings.h"
+#include "scanlib.h"
+#include "upgradedb_sqlite2tosqlite3.h"
 #include "albummanager.h"
 
 extern "C"
@@ -256,6 +258,25 @@
 
         d->db->setSetting("Locale",currLocale);
     }
+
+    // -- Check if we need to upgrade 0.7.x db to 0.8 db ---------------------
+
+    if (!upgradeDB_Sqlite2ToSqlite3(d->libraryPath))
+    {
+        KMessageBox::error(0, i18n("Failed to update old Database to new Database format"));
+        exit(0);
+    }
+    
+    // -- Check if we need to do scanning -------------------------------------
+
+    KConfig* config = KGlobal::config();
+    config->setGroup("General Settings");
+    if (config->readBoolEntry("Scan At Start", true) ||
+        d->db->getSetting("Scanned").isEmpty())
+    {
+        ScanLib sLib;
+        sLib.startScan();
+    }
 }
 
 QString AlbumManager::getLibraryPath() const
--- trunk/extragear/graphics/digikam/digikam/digikamapp.cpp #434646:434647
@@ -797,6 +797,8 @@
 void DigikamApp::slotSetupChanged()
 {
     mAlbumManager->setLibraryPath(mAlbumSettings->getAlbumLibraryPath());
+    mAlbumManager->startScan();
+
     mView->applySettings(mAlbumSettings);
     updateDeleteTrashMenu();
     if (ImageWindow::imagewindow())
--- trunk/extragear/graphics/digikam/digikam/main.cpp #434646:434647
@@ -50,8 +50,6 @@
 // Local includes.
 
 #include "version.h"
-#include "scanlib.h"
-#include "upgradedb_sqlite2tosqlite3.h"
 #include "albumdb.h"
 #include "albummanager.h"
 #include "digikamapp.h"
@@ -226,27 +224,9 @@
         return app.exec();
     }
 
-    // copy the db to a new temp file. we will use this copied db for testing
-    // purposes in 0.8 development. just a safety precautions for developers
-    // working on their main photo library
-
-    if (!upgradeDB_Sqlite2ToSqlite3(albumPath))
-    {
-        KMessageBox::error(0, i18n("Failed to update old Database to new Database format"));
-        return 0;
-    }
-
     AlbumManager* man = new AlbumManager();
     man->setLibraryPath(albumPath);
 
-    config->setGroup("General Settings");
-    if (config->readBoolEntry("Scan At Start", true) ||
-        man->albumDB()->getSetting("Scanned").isEmpty())
-    {
-        ScanLib sLib;
-        sLib.startScan();
-    }
-
     // Register image formats (especially for TIFF )
     KImageIO::registerFormats();
 
--- trunk/extragear/graphics/digikam/utilities/setup/setupgeneral.cpp #434646:434647
@@ -68,8 +68,6 @@
    QWhatsThis::add( albumPathEdit, i18n("<p>Here you can set the main path to the digiKam album "
                                         "library in your computer.\n"
                                         "Write access is required for this path."));
-   // TODO: disable this till changing album library path is fixed
-   albumPathEdit->setEnabled( false );
 
    QPushButton *changePathButton = new QPushButton(i18n("&Change..."),
                                                    albumPathBox);



More information about the Digikam-devel mailing list