[kde-doc-english] [digikam/sql/2.0] /: Split of settings/migration for images/thumbs DB

Francesco Riosa francesco+kde at pnpitalia.it
Mon Aug 1 23:51:36 UTC 2011


Git commit d9afaa0084b2a35bd2baa2ab365a54cd4a19ab4c by Francesco Riosa.
Committed on 02/08/2011 at 01:37.
Pushed by riosa into branch 'sql/2.0'.

Split of settings/migration for images/thumbs DB

This is the first step in really managing the Image metadata database
and the Thumbnail cache database as different entities.

Only changes in the gui are included and as is the code is not
functional, still need to be done:

1) change the structure of digikamrc and it's migration
2) define interaction between widgets in the new migration dialog
3) port and possibly unify "Settings -> database migration" with
"Settings -> configure digikam -> database settings"
4) add a "Backup" button

CCBUG: 277242
GUI: some new strings, work in progress

M  +2    -2    digikam/utils/albumsettings.h
M  +141  -38   libs/dialogs/migrationdlg.cpp
M  +2    -2    utilities/setup/setupdatabase.cpp
M  +4    -4    libs/widgets/common/databasewidget.h
M  +3    -3    libs/database/databaseparameters.cpp
M  +4    -1    libs/dialogs/migrationdlg.h
M  +8    -8    digikam/utils/albumsettings.cpp
M  +38   -35   libs/widgets/common/databasewidget.cpp

http://commits.kde.org/digikam/d9afaa0084b2a35bd2baa2ab365a54cd4a19ab4c

diff --git a/digikam/utils/albumsettings.cpp b/digikam/utils/albumsettings.cpp
index 7c80d54..17aa9bc 100644
--- a/digikam/utils/albumsettings.cpp
+++ b/digikam/utils/albumsettings.cpp
@@ -1544,10 +1544,10 @@ QString AlbumSettings::getDatabaseName() const
     return d->databaseParams.databaseName;
 }
 
-QString AlbumSettings::getDatabaseNameThumbnails() const
-{
-    return d->databaseParams.databaseNameThumbnails;
-}
+//fr QString AlbumSettings::getDatabaseNameThumbnails() const
+//fr {
+//fr     return d->databaseParams.databaseNameThumbnails;
+//fr }
 
 QString AlbumSettings::getDatabaseHostName() const
 {
@@ -1584,10 +1584,10 @@ void AlbumSettings::setDatabaseName(const QString& databaseName)
     d->databaseParams.databaseName = databaseName;
 }
 
-void AlbumSettings::setDatabaseNameThumbnails(const QString& databaseNameThumbnails)
-{
-    d->databaseParams.databaseNameThumbnails = databaseNameThumbnails;
-}
+//fr void AlbumSettings::setDatabaseNameThumbnails(const QString& databaseNameThumbnails)
+//fr {
+//fr     d->databaseParams.databaseNameThumbnails = databaseNameThumbnails;
+//fr }
 
 void AlbumSettings::setDatabaseHostName(const QString& hostName)
 {
diff --git a/digikam/utils/albumsettings.h b/digikam/utils/albumsettings.h
index 26196ac..96731be 100644
--- a/digikam/utils/albumsettings.h
+++ b/digikam/utils/albumsettings.h
@@ -333,8 +333,8 @@ public:
     QString getDatabaseName() const;
     void setDatabaseName(const QString& databaseName);
 
-    QString getDatabaseNameThumbnails() const;
-    void setDatabaseNameThumbnails(const QString& databaseNameThumbnails);
+    //fr QString getDatabaseNameThumbnails() const;
+    //fr void setDatabaseNameThumbnails(const QString& databaseNameThumbnails);
 
     QString getDatabaseHostName() const;
     void setDatabaseHostName(const QString& hostName);
diff --git a/libs/database/databaseparameters.cpp b/libs/database/databaseparameters.cpp
index f483ad7..f4f9d26 100644
--- a/libs/database/databaseparameters.cpp
+++ b/libs/database/databaseparameters.cpp
@@ -49,7 +49,7 @@ static const char* configGroupDatabase = "Database Settings";
 static const char* configInternalDatabaseServer = "Internal Database Server";
 static const char* configDatabaseType = "Database Type";
 static const char* configDatabaseName = "Database Name";
-static const char* configDatabaseNameThumbnails = "Database Name Thumbnails";
+//fr static const char* configDatabaseNameThumbnails = "Database Name Thumbnails";
 static const char* configDatabaseHostName = "Database Hostname";
 static const char* configDatabasePort = "Database Port";
 static const char* configDatabaseUsername = "Database Username";
@@ -206,7 +206,7 @@ void DatabaseParameters::readFromConfig(KSharedConfig::Ptr config, const QString
 
     databaseType             = group.readEntry(configDatabaseType, QString());
     databaseName             = group.readEntry(configDatabaseName, QString());
-    databaseNameThumbnails   = group.readEntry(configDatabaseNameThumbnails, QString());
+    //fr databaseNameThumbnails   = group.readEntry(configDatabaseNameThumbnails, QString());
     hostName                 = group.readEntry(configDatabaseHostName, QString());
     port                     = group.readEntry(configDatabasePort, -1);
     userName                 = group.readEntry(configDatabaseUsername, QString());
@@ -357,7 +357,7 @@ void DatabaseParameters::writeToConfig(KSharedConfig::Ptr config, const QString&
 
     group.writeEntry(configDatabaseType, databaseType);
     group.writeEntry(configDatabaseName, dbName);
-    group.writeEntry(configDatabaseNameThumbnails, dbNameThumbs);
+    //fr group.writeEntry(configDatabaseNameThumbnails, dbNameThumbs);
     group.writeEntry(configDatabaseHostName, hostName);
     group.writeEntry(configDatabasePort, port);
     group.writeEntry(configDatabaseUsername, userName);
diff --git a/libs/dialogs/migrationdlg.cpp b/libs/dialogs/migrationdlg.cpp
index 94a5d31..6fe993e 100644
--- a/libs/dialogs/migrationdlg.cpp
+++ b/libs/dialogs/migrationdlg.cpp
@@ -44,6 +44,7 @@
 
 // Local includes
 
+#include "config-digikam.h"
 #include "albumsettings.h"
 #include "databaseaccess.h"
 #include "databasewidget.h"
@@ -95,24 +96,51 @@ class MigrationDlg::MigrationDlgPriv
 public:
 
     MigrationDlgPriv() :
-        fromDatabaseWidget(0),
-        toDatabaseWidget(0),
-        migrateButton(0),
-        cancelButton(0),
+        // Img database
+        fromImgDatabaseWidget(0),
+        toImgDatabaseWidget(0),
+        migrateImgButton(0),
+        cancelImgButton(0),
+#ifdef USE_THUMBS_DB
+        // Thumb database
+        fromThumbDatabaseWidget(0),
+        toThumbDatabaseWidget(0),
+        migrateThumbButton(0),
+        cancelThumbButton(0),
+#endif
+        // Global
         overallStepTitle(0),
         progressBar(0),
         progressBarSmallStep(0),
+        sameDatabase(0),
+        internalFromServer(0),
+#ifdef HAVE_INTERNALMYSQL
+        internalToServer(0),
+#endif
         copyThread(0)
     {
     }
-
-    DatabaseWidget*     fromDatabaseWidget;
-    DatabaseWidget*     toDatabaseWidget;
-    QPushButton*        migrateButton;
-    QPushButton*        cancelButton;
+    // Img database
+    DatabaseWidget*     fromImgDatabaseWidget;
+    DatabaseWidget*     toImgDatabaseWidget;
+    QPushButton*        migrateImgButton;
+    QPushButton*        cancelImgButton;
+#ifdef USE_THUMBS_DB
+    // Thumb database
+    DatabaseWidget*     fromThumbDatabaseWidget;
+    DatabaseWidget*     toThumbDatabaseWidget;
+    QPushButton*        migrateThumbButton;
+    QPushButton*        cancelThumbButton;
+#endif
+    // Global
     QLabel*             overallStepTitle;
     QProgressBar*       progressBar;
     QProgressBar*       progressBarSmallStep;
+    QCheckBox*          sameDatabase;
+    QCheckBox*          internalFromServer;
+#ifdef HAVE_INTERNALMYSQL
+    QCheckBox*          internalToServer;
+#endif
     DatabaseCopyThread* copyThread;
 };
 
@@ -131,11 +159,23 @@ MigrationDlg::~MigrationDlg()
 void MigrationDlg::setupMainArea()
 {
     d->copyThread                      = new DatabaseCopyThread(this);
-    d->fromDatabaseWidget              = new DatabaseWidget(this);
-    d->toDatabaseWidget                = new DatabaseWidget(this);
-    d->migrateButton                   = new QPushButton(i18n("Migrate ->"), this);
-    d->cancelButton                    = new QPushButton(i18n("Cancel"), this);
-    d->cancelButton->setEnabled(false);
+    d->fromImgDatabaseWidget           = new DatabaseWidget(this, i18n("current images DB"));
+    d->toImgDatabaseWidget             = new DatabaseWidget(this, i18n("dest. images DB"));
+    d->migrateImgButton                = new QPushButton(i18n("Migrate ->"), this);
+    d->cancelImgButton                 = new QPushButton(i18n("Cancel"), this);
+    d->cancelImgButton->setEnabled(false);
+#ifdef USE_THUMBS_DB
+    d->fromThumbDatabaseWidget         = new DatabaseWidget(this, i18n("current thumbnail DB"));
+    d->toThumbDatabaseWidget           = new DatabaseWidget(this, i18n("dest. thumbnail DB"));
+    d->migrateThumbButton              = new QPushButton(i18n("Migrate ->"), this);
+    d->cancelThumbButton               = new QPushButton(i18n("Cancel"), this);
+    d->cancelThumbButton->setEnabled(false);
+#endif
+    d->sameDatabase                    = new QCheckBox(i18n("Same database"), this);
+    d->internalFromServer              = new QCheckBox(i18n("Internal server"), this);
+#ifdef HAVE_INTERNALMYSQL
+    d->internalToServer                = new QCheckBox(i18n("Internal server"), this);
+#endif
 
     QGroupBox* progressBox             = new QGroupBox(i18n("Progress Information"), this);
     QVBoxLayout* vlay                  = new QVBoxLayout(progressBox);
@@ -157,13 +197,26 @@ void MigrationDlg::setupMainArea()
     QGridLayout* layout = new QGridLayout;
     mainWidget->setLayout(layout);
 
-    layout->addWidget(d->fromDatabaseWidget,   0, 0, 4, 1);
-    layout->addWidget(d->migrateButton,        1, 1);
-    layout->addWidget(d->cancelButton,         2, 1);
-    layout->addWidget(d->toDatabaseWidget,     0, 2, 4, 1);
-    layout->addWidget(progressBox,             4, 0, 1, 3);
-//  layout->addWidget(d->progressBar,          4, 0, 1, 3);
-//  layout->addWidget(d->progressBarSmallStep, 5, 0, 1, 3);
+    layout->addWidget(d->internalFromServer,       0, 0);
+#ifdef HAVE_INTERNALMYSQL
+    layout->addWidget(d->internalToServer,         0, 2);
+#endif
+
+    layout->addWidget(d->fromImgDatabaseWidget,    1, 0, 3, 1);
+    layout->addWidget(d->migrateImgButton,         2, 1);
+    layout->addWidget(d->cancelImgButton,          3, 1);
+    layout->addWidget(d->toImgDatabaseWidget,      1, 2, 3, 1);
+
+    layout->addWidget(d->sameDatabase,             5, 2);
+
+#ifdef USE_THUMBS_DB
+    layout->addWidget(d->fromThumbDatabaseWidget,  6, 0, 3, 1);
+    layout->addWidget(d->migrateThumbButton,       7, 1);
+    layout->addWidget(d->cancelThumbButton,        8, 1);
+    layout->addWidget(d->toThumbDatabaseWidget,    6, 2, 3, 1);
+#endif
+
+    layout->addWidget(progressBox,                10, 0, 1, 3);
 
     setMainWidget(mainWidget);
     dataInit();
@@ -171,8 +224,19 @@ void MigrationDlg::setupMainArea()
     // setup dialog
     setButtons(Close);
 
-    connect(d->migrateButton, SIGNAL(clicked()),
-            this, SLOT(performCopy()));
+    connect(d->migrateImgButton, SIGNAL(clicked()),
+            this, SLOT(performImgCopy()));
+
+    connect(d->cancelImgButton, SIGNAL(clicked()),
+            &(d->copyThread->copyManager), SLOT(stopProcessing()));
+
+#ifdef USE_THUMBS_DB
+    connect(d->migrateThumbButton, SIGNAL(clicked()),
+            this, SLOT(performThumbCopy()));
+
+    connect(d->cancelThumbButton, SIGNAL(clicked()),
+            &(d->copyThread->copyManager), SLOT(stopProcessing()));
+#endif
 
     // connect signal handlers for copy d->copyThread
     connect(&(d->copyThread->copyManager), SIGNAL(finished(int, QString)),
@@ -187,43 +251,82 @@ void MigrationDlg::setupMainArea()
     connect(this, SIGNAL(closeClicked()),
             &(d->copyThread->copyManager), SLOT(stopProcessing()));
 
-    connect(d->cancelButton, SIGNAL(clicked()),
-            &(d->copyThread->copyManager), SLOT(stopProcessing()));
 }
 
-void MigrationDlg::performCopy()
+void MigrationDlg::performImgCopy()
+{
+    KMessageBox::information(this, i18n("TODO: performImgCopy") );
+    return;
+    DatabaseParameters toDBParameters   = d->toImgDatabaseWidget->getDatabaseParameters();
+    DatabaseParameters fromDBParameters = d->fromImgDatabaseWidget->getDatabaseParameters();
+    d->copyThread->init(fromDBParameters, toDBParameters);
+
+    lockInputFields();
+    d->copyThread->start();
+}
+
+#ifdef USE_THUMBS_DB
+void MigrationDlg::performThumbCopy()
 {
-    DatabaseParameters toDBParameters   = d->toDatabaseWidget->getDatabaseParameters();
-    DatabaseParameters fromDBParameters = d->fromDatabaseWidget->getDatabaseParameters();
+    KMessageBox::information(this, i18n("TODO: performThumbCopy") );
+    return;
+    DatabaseParameters toDBParameters   = d->toThumbDatabaseWidget->getDatabaseParameters();
+    DatabaseParameters fromDBParameters = d->fromThumbDatabaseWidget->getDatabaseParameters();
     d->copyThread->init(fromDBParameters, toDBParameters);
 
     lockInputFields();
     d->copyThread->start();
 }
+#endif
 
 void MigrationDlg::dataInit()
 {
-    d->fromDatabaseWidget->setParametersFromSettings(AlbumSettings::instance());
-    d->toDatabaseWidget->setParametersFromSettings(AlbumSettings::instance());
+    d->fromImgDatabaseWidget->setParametersFromSettings(AlbumSettings::instance());
+    d->toImgDatabaseWidget->setParametersFromSettings(AlbumSettings::instance());
+#ifdef USE_THUMBS_DB
+    //fr TODO: change database name
+    d->fromThumbDatabaseWidget->setParametersFromSettings(AlbumSettings::instance());
+    d->toThumbDatabaseWidget->setParametersFromSettings(AlbumSettings::instance());
+#endif
 }
 
 void MigrationDlg::unlockInputFields()
 {
-    d->fromDatabaseWidget->setEnabled(true);
-    d->toDatabaseWidget->setEnabled(true);
-    d->migrateButton->setEnabled(true);
+    d->fromImgDatabaseWidget->setEnabled(true);
+    d->toImgDatabaseWidget->setEnabled(true);
+    d->migrateImgButton->setEnabled(true);
+
+#ifdef USE_THUMBS_DB
+    d->fromThumbDatabaseWidget->setEnabled(true);
+    d->toThumbDatabaseWidget->setEnabled(true);
+    d->migrateThumbButton->setEnabled(true);
+#endif
+
     d->progressBar->setValue(0);
     d->progressBarSmallStep->setValue(0);
 
-    d->cancelButton->setEnabled(false);
+    d->cancelImgButton->setEnabled(false);
+#ifdef USE_THUMBS_DB
+    d->cancelThumbButton->setEnabled(false);
+#endif
 }
 
 void MigrationDlg::lockInputFields()
 {
-    d->fromDatabaseWidget->setEnabled(false);
-    d->toDatabaseWidget->setEnabled(false);
-    d->migrateButton->setEnabled(false);
-    d->cancelButton->setEnabled(true);
+    d->fromImgDatabaseWidget->setEnabled(false);
+    d->toImgDatabaseWidget->setEnabled(false);
+    d->migrateImgButton->setEnabled(false);
+
+#ifdef USE_THUMBS_DB
+    d->fromThumbDatabaseWidget->setEnabled(false);
+    d->toThumbDatabaseWidget->setEnabled(false);
+    d->migrateThumbButton->setEnabled(false);
+#endif
+
+    d->cancelImgButton->setEnabled(true);
+#ifdef USE_THUMBS_DB
+    d->cancelThumbButton->setEnabled(true);
+#endif
 }
 
 void MigrationDlg::handleFinish(int finishState, QString errorMsg)
diff --git a/libs/dialogs/migrationdlg.h b/libs/dialogs/migrationdlg.h
index 686379e..8888995 100644
--- a/libs/dialogs/migrationdlg.h
+++ b/libs/dialogs/migrationdlg.h
@@ -77,7 +77,10 @@ public:
 
 private Q_SLOTS:
 
-    void performCopy();
+    void performImgCopy();
+#ifdef USE_THUMBS_DB
+    void performThumbCopy();
+#endif
     void unlockInputFields();
     void lockInputFields();
 
diff --git a/libs/widgets/common/databasewidget.cpp b/libs/widgets/common/databasewidget.cpp
index fe86bfa..47a49e9 100644
--- a/libs/widgets/common/databasewidget.cpp
+++ b/libs/widgets/common/databasewidget.cpp
@@ -67,10 +67,10 @@ public:
     QGroupBox* expertSettings;
 };
 
-DatabaseWidget::DatabaseWidget(QWidget* parent)
+DatabaseWidget::DatabaseWidget(QWidget* parent, const QString & title)
     : QWidget(parent), d(new DatabaseWidgetPriv)
 {
-    setupMainArea();
+    setupMainArea(title);
 }
 
 DatabaseWidget::~DatabaseWidget()
@@ -78,7 +78,7 @@ DatabaseWidget::~DatabaseWidget()
     delete d;
 }
 
-void DatabaseWidget::setupMainArea()
+void DatabaseWidget::setupMainArea(const QString & title)
 {
     setAutoFillBackground(false);
 
@@ -87,7 +87,7 @@ void DatabaseWidget::setupMainArea()
 
     // --------------------------------------------------------
 
-    QGroupBox* dbPathBox = new QGroupBox(i18n("Database File Path"), this);
+    QGroupBox* dbPathBox = new QGroupBox(title, this);
     QVBoxLayout* vlay    = new QVBoxLayout(dbPathBox);
     d->databasePathLabel = new QLabel(i18n("<p>The location where the database file will be stored on your system. "
                                            "There is one common database file for all root albums.<br/>"
@@ -102,12 +102,12 @@ void DatabaseWidget::setupMainArea()
 
     QLabel* databaseTypeLabel           = new QLabel(i18n("Type"));
     databaseType                        = new QComboBox();
-    QLabel* internalServerLabel         = new QLabel(i18n("Internal Server"));
-    internalServer                      = new QCheckBox();
+    //fr QLabel* internalServerLabel         = new QLabel(i18n("Internal Server"));
+    //fr internalServer                      = new QCheckBox();
     QLabel* databaseNameLabel           = new QLabel(i18n("Schema Name"));
     databaseName                        = new QLineEdit();
-    QLabel* databaseNameThumbnailsLabel = new QLabel(i18n("Thumbnails<br>Schema Name"));
-    databaseNameThumbnails              = new QLineEdit();
+    //fr QLabel* databaseNameThumbnailsLabel = new QLabel(i18n("Thumbnails<br>Schema Name"));
+    //fr databaseNameThumbnails              = new QLineEdit();
     QLabel* hostNameLabel               = new QLabel(i18n("Host Name"));
     hostName                            = new QLineEdit();
     QLabel* hostPortLabel               = new QLabel(i18n("Port"));
@@ -131,13 +131,13 @@ void DatabaseWidget::setupMainArea()
     QFormLayout* expertSettinglayout    = new QFormLayout();
     d->expertSettings->setLayout(expertSettinglayout);
 
-#ifdef HAVE_INTERNALMYSQL
-    expertSettinglayout->addRow(internalServerLabel, internalServer);
-#endif // HAVE_INTERNALMYSQL
+//fr #ifdef HAVE_INTERNALMYSQL
+//fr     expertSettinglayout->addRow(internalServerLabel, internalServer);
+//fr #endif // HAVE_INTERNALMYSQL
     expertSettinglayout->addRow(hostNameLabel, hostName);
     expertSettinglayout->addRow(hostPortLabel, hostPort);
     expertSettinglayout->addRow(databaseNameLabel, databaseName);
-    expertSettinglayout->addRow(databaseNameThumbnailsLabel, databaseNameThumbnails);
+    //fr expertSettinglayout->addRow(databaseNameThumbnailsLabel, databaseNameThumbnails);
     expertSettinglayout->addRow(userNameLabel, userName);
     expertSettinglayout->addRow(passwordLabel, password);
     expertSettinglayout->addRow(connectionOptionsLabel, connectionOptions);
@@ -180,10 +180,10 @@ void DatabaseWidget::setupMainArea()
     connect(databaseType, SIGNAL(currentIndexChanged(int)),
             this, SLOT(slotHandleDBTypeIndexChanged(int)));
 
-#ifdef HAVE_INTERNALMYSQL
-    connect(internalServer, SIGNAL(stateChanged(int)),
-            this, SLOT(slotHandleInternalServerCheckbox(int)));
-#endif // HAVE_INTERNALMYSQL
+//fr #ifdef HAVE_INTERNALMYSQL
+//fr     connect(internalServer, SIGNAL(stateChanged(int)),
+//fr             this, SLOT(slotHandleInternalServerCheckbox(int)));
+//fr #endif // HAVE_INTERNALMYSQL
 
     connect(checkDatabaseConnectionButton, SIGNAL(clicked()),
             this, SLOT(checkDatabaseConnection()));
@@ -254,16 +254,16 @@ void DatabaseWidget::setDatabaseInputFields(const QString& currentIndexStr)
     adjustSize();
 }
 
-void DatabaseWidget::slotHandleInternalServerCheckbox(int enableFields)
-{
-    hostName->setEnabled(enableFields == Qt::Unchecked);
-    hostPort->setEnabled(enableFields == Qt::Unchecked);
-    databaseName->setEnabled(enableFields == Qt::Unchecked);
-    databaseNameThumbnails->setEnabled(enableFields == Qt::Unchecked);
-    userName->setEnabled(enableFields == Qt::Unchecked);
-    password->setEnabled(enableFields == Qt::Unchecked);
-    connectionOptions->setEnabled(enableFields == Qt::Unchecked);
-}
+//fr void DatabaseWidget::slotHandleInternalServerCheckbox(int enableFields)
+//fr {
+//fr     hostName->setEnabled(enableFields == Qt::Unchecked);
+//fr     hostPort->setEnabled(enableFields == Qt::Unchecked);
+//fr     databaseName->setEnabled(enableFields == Qt::Unchecked);
+//fr     //fr databaseNameThumbnails->setEnabled(enableFields == Qt::Unchecked);
+//fr     userName->setEnabled(enableFields == Qt::Unchecked);
+//fr     password->setEnabled(enableFields == Qt::Unchecked);
+//fr     connectionOptions->setEnabled(enableFields == Qt::Unchecked);
+//fr }
 
 void DatabaseWidget::checkDatabaseConnection()
 {
@@ -322,13 +322,13 @@ void DatabaseWidget::setParametersFromSettings(const AlbumSettings* settings)
     originalDbType = settings->getDatabaseType();
     databasePathEdit->setUrl(settings->getDatabaseFilePath());
 
-#ifdef HAVE_INTERNALMYSQL
-    internalServer->setChecked(settings->getInternalDatabaseServer());
-#else
-    internalServer->setChecked(false);
-#endif // HAVE_INTERNALMYSQL
+//fr #ifdef HAVE_INTERNALMYSQL
+//fr     internalServer->setChecked(settings->getInternalDatabaseServer());
+//fr #else
+//fr     internalServer->setChecked(false);
+//fr #endif // HAVE_INTERNALMYSQL
     databaseName->setText(settings->getDatabaseName());
-    databaseNameThumbnails->setText(settings->getDatabaseNameThumbnails());
+    //fr databaseNameThumbnails->setText(settings->getDatabaseNameThumbnails());
     hostName->setText(settings->getDatabaseHostName());
     hostPort->setValue(settings->getDatabasePort());
     connectionOptions->setText(settings->getDatabaseConnectoptions());
@@ -355,7 +355,8 @@ DatabaseParameters DatabaseWidget::getDatabaseParameters()
 {
     DatabaseParameters parameters;
 
-    if (currentDatabaseType() == QString(DatabaseParameters::SQLiteDatabaseType()) || !internalServer->isChecked())
+    //fr if (currentDatabaseType() == QString(DatabaseParameters::SQLiteDatabaseType()) || !internalServer->isChecked())
+    if (currentDatabaseType() == QString(DatabaseParameters::SQLiteDatabaseType()))
     {
         parameters.connectOptions = connectionOptions->text();
         parameters.databaseType   = currentDatabaseType();
@@ -367,12 +368,14 @@ DatabaseParameters DatabaseWidget::getDatabaseParameters()
         if (parameters.databaseType == QString(DatabaseParameters::SQLiteDatabaseType()))
         {
             parameters.databaseName = QDir::cleanPath(databasePathEdit->url().toLocalFile() + '/' + "digikam4.db");
-            parameters.databaseNameThumbnails = parameters.databaseName;
+            //fr parameters.databaseNameThumbnails = parameters.databaseName;
+            parameters.databaseNameThumbnails = parameters.databaseName; //fr
         }
         else
         {
             parameters.databaseName = databaseName->text();
-            parameters.databaseNameThumbnails = databaseNameThumbnails->text();
+            //fr parameters.databaseNameThumbnails = databaseNameThumbnails->text();
+            parameters.databaseNameThumbnails = parameters.databaseName; //fr
         }
     }
     else
diff --git a/libs/widgets/common/databasewidget.h b/libs/widgets/common/databasewidget.h
index a19fc74..b440fe6 100644
--- a/libs/widgets/common/databasewidget.h
+++ b/libs/widgets/common/databasewidget.h
@@ -53,7 +53,7 @@ class DatabaseWidget : public QWidget
 
 public:
 
-    DatabaseWidget(QWidget* parent = 0);
+    DatabaseWidget(QWidget* parent = 0, const QString & title = QString(""));
     ~DatabaseWidget();
 
 public:
@@ -65,7 +65,7 @@ public:
     QSpinBox*      hostPort;
 
     QLineEdit*     databaseName;
-    QLineEdit*     databaseNameThumbnails;
+    //fr QLineEdit*     databaseNameThumbnails;
     QLineEdit*     hostName;
     QLineEdit*     connectionOptions;
     QLineEdit*     userName;
@@ -86,13 +86,13 @@ public Q_SLOTS:
     void slotChangeDatabasePath(const KUrl&);
     void slotDatabasePathEdited(const QString&);
     void slotHandleDBTypeIndexChanged(int index);
-    void slotHandleInternalServerCheckbox(int enableFields);
+    //fr void slotHandleInternalServerCheckbox(int enableFields);
     void checkDatabaseConnection();
 
 private:
 
     void checkDBPath();
-    void setupMainArea();
+    void setupMainArea(const QString & title);
 
 private:
 
diff --git a/utilities/setup/setupdatabase.cpp b/utilities/setup/setupdatabase.cpp
index b9fbea5..c9db2b5 100644
--- a/utilities/setup/setupdatabase.cpp
+++ b/utilities/setup/setupdatabase.cpp
@@ -177,7 +177,7 @@ void SetupDatabase::applySettings()
             settings->setInternalDatabaseServer(true);
             settings->setDatabaseType(d->databaseWidget->currentDatabaseType());
             settings->setDatabaseName(internalServerParameters.databaseName);
-            settings->setDatabaseNameThumbnails(internalServerParameters.databaseName);
+            //fr settings->setDatabaseNameThumbnails(internalServerParameters.databaseName);
             settings->setDatabaseConnectoptions(internalServerParameters.connectOptions);
             settings->setDatabaseHostName(internalServerParameters.hostName);
             settings->setDatabasePort(internalServerParameters.port);
@@ -189,7 +189,7 @@ void SetupDatabase::applySettings()
             settings->setInternalDatabaseServer(d->databaseWidget->internalServer->isChecked());
             settings->setDatabaseType(d->databaseWidget->currentDatabaseType());
             settings->setDatabaseName(d->databaseWidget->databaseName->text());
-            settings->setDatabaseNameThumbnails(d->databaseWidget->databaseNameThumbnails->text());
+            //fr settings->setDatabaseNameThumbnails(d->databaseWidget->databaseNameThumbnails->text());
             settings->setDatabaseConnectoptions(d->databaseWidget->connectionOptions->text());
             settings->setDatabaseHostName(d->databaseWidget->hostName->text());
             settings->setDatabasePort(d->databaseWidget->hostPort->text().toInt());



More information about the kde-doc-english mailing list