[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/extragear/graphics/digikam
From:       Holger Foerster <hamsi2k () freenet ! de>
Date:       2010-08-31 10:44:15
Message-ID: 20100831104415.C933EAC857 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1170255 by foerster:

Improved internal server support. The database was closed before the user was able to \
start the application.  A temporary dummy dbus service is created which prevents an \
internal database shutdown.

Also there are improvements about using the innodb backend of MySQL.


 M  +10 -10    data/database/dbconfig.xml.cmake  
 M  +2 -1      databaseserver/pollthread.cpp  
 M  +16 -0     digikam/main.cpp  


--- branches/extragear/graphics/digikam/data/database/dbconfig.xml.cmake \
#1170254:1170255 @@ -695,8 +695,8 @@
         <password></password>
         <port>1</port>
         <connectoptions>UNIX_SOCKET=$$DBMISCPATH$$/mysql.socket</connectoptions>
-        <dbservercmd>${SERVERCMD_MYSQL}</dbservercmd>
-        <dbinitcmd>${INITCMD_MYSQL}</dbinitcmd>
+        <dbservercmd>/usr/sbin/mysqld</dbservercmd>
+        <dbinitcmd>/usr/bin/mysql_install_db</dbinitcmd>
 
         <dbactions>
         	<dbaction name="CheckPriv_CREATE_TRIGGER"><statement mode="plain">
@@ -742,7 +742,7 @@
             type INTEGER NOT NULL,
             identifier LONGTEXT,
             specificPath LONGTEXT,
-            UNIQUE(identifier(167), specificPath(166)));</statement>
+            UNIQUE(identifier(127), specificPath(128)));</statement>
             <statement mode="plain">CREATE TABLE Albums
                             (id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
                             albumRoot INTEGER NOT NULL,
@@ -751,7 +751,7 @@
                             caption LONGTEXT CHARACTER SET utf8,
                             collection LONGTEXT CHARACTER SET utf8,
                             icon INTEGER,
-                            UNIQUE(albumRoot, relativePath(332)));</statement>
+                            UNIQUE(albumRoot, relativePath(255)));</statement>
             <statement mode="plain">CREATE TABLE Images
                             (id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
                             album INTEGER,
@@ -761,7 +761,7 @@
                             modificationDate DATETIME,
                             fileSize INTEGER,
                             uniqueHash VARCHAR(128),
-                            UNIQUE (album, name(332)));</statement>
+                            UNIQUE (album, name(255)));</statement>
             <statement mode="plain">CREATE TABLE ImageHaarMatrix
                             (imageid INTEGER PRIMARY KEY,
                             modificationDate DATETIME,
@@ -845,7 +845,7 @@
                             (imageid  INTEGER NOT NULL,
                             property LONGTEXT CHARACTER SET utf8    NOT NULL,
                             value    LONGTEXT CHARACTER SET utf8    NOT NULL,
-                            UNIQUE (imageid, property(332)));</statement>
+                            UNIQUE (imageid, property(255)));</statement>
             <statement mode="plain">CREATE TABLE IF NOT EXISTS Searches
                             (id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
                             type INTEGER,
@@ -861,7 +861,7 @@
             <statement mode="plain">CREATE TABLE IF NOT EXISTS Settings
                             (keyword LONGTEXT CHARACTER SET utf8 NOT NULL,
                             value LONGTEXT CHARACTER SET utf8,
-                            UNIQUE(keyword(333)));</statement>
+                            UNIQUE(keyword(255)));</statement>
             <statement mode="plain">CREATE TABLE ImageHistory
                             (imageid INTEGER PRIMARY KEY,
                              uuid VARCHAR(128),
@@ -1096,17 +1096,17 @@
                 <statement mode="plain">CREATE TABLE FilePaths
                             (path LONGTEXT CHARACTER SET utf8,
                             thumbId INTEGER,
-                            UNIQUE(path(333)))
+                            UNIQUE(path(255)))
                 </statement>
                 <statement mode="plain">CREATE TABLE CustomIdentifiers
                             (identifier LONGTEXT CHARACTER SET utf8,
                             thumbId INTEGER,
-                            UNIQUE(identifier(333)))
+                            UNIQUE(identifier(255)))
                 </statement>
                 <statement mode="plain">CREATE TABLE IF NOT EXISTS Settings
                             (keyword LONGTEXT CHARACTER SET utf8 NOT NULL,
                             value LONGTEXT CHARACTER SET utf8,
-                            UNIQUE(keyword(333)))
+                            UNIQUE(keyword(255)))
                 </statement>
             </dbaction>
             <!-- Thumbnails Indexes DB -->
--- branches/extragear/graphics/digikam/databaseserver/pollthread.cpp \
#1170254:1170255 @@ -78,11 +78,12 @@
    if (reply.isValid())
    {
        QStringList serviceNames = reply.value();
+       QLatin1String digikamStartupService("org.kde.digikam.startup-");
        QLatin1String digikamService("org.kde.digikam-");
        QLatin1String digikamKioService("org.kde.digikam.KIO-");
        foreach (const QString &service, serviceNames)
        {
-           if (service.startsWith(digikamService) || \
service.startsWith(digikamKioService)) +           if \
(service.startsWith(digikamStartupService) || service.startsWith(digikamService) || \
service.startsWith(digikamKioService))  {
                kDebug() << "At least service ["<< service <<"] is using the database \
server";  // At least one digikam/kio service was found
--- branches/extragear/graphics/digikam/digikam/main.cpp #1170254:1170255
@@ -30,6 +30,7 @@
 #include <QFileInfo>
 #include <QFile>
 #include <QSqlDatabase>
+#include <QDBusConnection>
 
 // KDE includes
 
@@ -165,12 +166,27 @@
         params.writeToConfig(config);
     }
 
+    /*
+     * Register a dummy service on dbus.
+     * This is needed for the internal database server, which checks if at least one
+     * digikam instance is running on dbus.
+     * The first real dbus instance is registered within the DigikamApp() \
constructor, +     * so we create a service on dbus which is unregistered after \
initialization the application. +     */
+    QDBusConnection::sessionBus().registerService("org.kde.digikam.startup-"
+                            + \
QString::number(QCoreApplication::instance()->applicationPid())); +
     // initialize database
     AlbumManager::instance()->setDatabase(params, !commandLineDBPath.isNull(), \
firstAlbumPath);  
     // create main window
     DigikamApp *digikam = new DigikamApp();
 
+    // Unregister the dummy service
+    QDBusConnection::sessionBus().unregisterService("org.kde.digikam.startup-"
+                            + \
QString::number(QCoreApplication::instance()->applicationPid())); +
+
     app.setTopWidget(digikam);
     digikam->restoreSession();
     digikam->show();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic