[Digikam-users] extragear/graphics/digikam

Tom Albers tomalbers at kde.nl
Mon Dec 26 20:18:31 GMT 2005


SVN commit 491610 by toma:

Fix the unsupported feature --enable-nfs-hack again. Adjusted the upgradedb class to convert to and from a digikam compiled with that parameter. Also fixed the kioslave, which did not included the config.h, thus NFS_HACK contained the wrong value, so the hack did not work at all in 0.8.0.

Please test if you are using this unsupported feature.
CCMAIL: digikam-users at kde.org
BUG: 118543



 M  +20 -4     digikam/upgradedb_sqlite2tosqlite3.cpp  
 M  +2 -0      kioslave/sqlitedb.cpp  


--- trunk/extragear/graphics/digikam/digikam/upgradedb_sqlite2tosqlite3.cpp #491609:491610
@@ -25,6 +25,8 @@
 #include <qfileinfo.h>
 
 #include <kdebug.h>
+#include <kstandarddirs.h>
+#include <kio/global.h>
 #include <iostream>
 
 #include "albumdb.h"
@@ -85,9 +87,15 @@
 {
     QString libraryPath = QDir::cleanDirPath(_libraryPath);
 
+    QString newDB= libraryPath + "/digikam3.db";
+
+#ifdef NFS_HACK
+    newDB = locateLocal("appdata", KIO::encodeFileName(QDir::cleanDirPath(newDB)));
+    kdDebug() << "NFS: " << newDB << endl;
+#endif
+    
     AlbumDB db3;
-    db3.setDBPath(libraryPath + "/digikam3.db");
-    
+    db3.setDBPath(newDB);
     if (!db3.isValid())
     {
 	kdWarning() << "Failed to open new Album Database" << endl;
@@ -97,7 +105,15 @@
     if (db3.getSetting("UpgradedFromSqlite2") == "yes")
 	return true;
 
-    QFileInfo fi(libraryPath + "/digikam.db");
+    QString dbPath = libraryPath + "/digikam.db";
+
+#ifdef NFS_HACK
+    dbPath = locateLocal("appdata", KIO::encodeFileName(QDir::cleanDirPath(dbPath)));
+    kdDebug() << "From NFS: " << dbPath << endl;
+#endif
+        
+    QFileInfo fi(dbPath);
+
     if (!fi.exists())
     {
 	kdDebug() << "No old database present. Not upgrading" << endl;
@@ -106,7 +122,7 @@
     }
 
     AlbumDB_Sqlite2 db2;
-    db2.setDBPath(libraryPath + "/digikam.db");
+    db2.setDBPath( dbPath );
     if (!db2.isValid())
     {
 	kdDebug() << "Failed to initialize Old Album Database" << endl;
--- trunk/extragear/graphics/digikam/kioslave/sqlitedb.cpp #491609:491610
@@ -28,6 +28,8 @@
 
 #include "sqlitedb.h"
 
+#include "config.h" // Needed for NFS_HACK
+
 SqliteDB::SqliteDB()
 {
     m_db = 0;



More information about the Digikam-users mailing list