~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to libs/widgets/common/databasewidget.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-21 23:19:11 UTC
  • mfrom: (1.2.33 upstream) (3.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221231911-z9jip7s5aht1jqn9
Tags: 2:1.7.0-1ubuntu1
* Merge from Debian Experimental. Remaining Ubuntu changes:
  - Export .pot name and copy to plugins in debian/rules
  - Version build-depends on kipi-plugins-dev to ensure build is against the
    same version on all archs
* Drop debian/patches/kubuntu_01_linker.diff, incoporated upstream
* Remove patches directory and unused patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
};
68
68
 
69
69
DatabaseWidget::DatabaseWidget(QWidget* parent)
70
 
              : QWidget(parent), d(new DatabaseWidgetPriv)
 
70
    : QWidget(parent), d(new DatabaseWidgetPriv)
71
71
{
72
72
    setupMainArea();
73
73
}
92
92
                                           "There is one common database file for all root albums.<br/>"
93
93
                                           "Write access is required to be able to edit image properties.</p>"
94
94
                                           "<p>Note: a remote file system, such as NFS, cannot be used here.</p><p></p>"),
95
 
                                           dbPathBox);
 
95
                                      dbPathBox);
96
96
    d->databasePathLabel->setWordWrap(true);
97
97
    d->databasePathLabel->setFont(KGlobalSettings::smallestReadableFont());
98
98
 
205
205
#endif
206
206
    {
207
207
        KMessageBox::information(0, i18n("You do not seem to have write access to this database folder.\n"
208
 
                                            "Without this access, the caption and tag features will not work."));
 
208
                                         "Without this access, the caption and tag features will not work."));
209
209
    }
210
210
 
211
211
    checkDBPath();
214
214
void DatabaseWidget::slotDatabasePathEdited(const QString& newPath)
215
215
{
216
216
#ifndef _WIN32
 
217
 
217
218
    if (!newPath.isEmpty() && !QDir::isAbsolutePath(newPath))
218
219
    {
219
220
        databasePathEdit->setUrl(QDir::homePath() + '/' + newPath);
220
221
    }
 
222
 
221
223
#endif
222
224
 
223
225
    checkDBPath();
225
227
 
226
228
void DatabaseWidget::slotHandleDBTypeIndexChanged(int index)
227
229
{
228
 
        const QString& dbType = databaseType->itemData(index).toString();
229
 
        setDatabaseInputFields(dbType);
 
230
    const QString& dbType = databaseType->itemData(index).toString();
 
231
    setDatabaseInputFields(dbType);
230
232
}
231
233
 
232
234
void DatabaseWidget::setDatabaseInputFields(const QString& currentIndexStr)
309
311
    //d->mainDialog->enableButtonOk(dbOk);
310
312
}
311
313
 
312
 
void DatabaseWidget::setParametersFromSettings(const AlbumSettings *settings)
 
314
void DatabaseWidget::setParametersFromSettings(const AlbumSettings* settings)
313
315
{
314
316
    originalDbPath = settings->getDatabaseFilePath();
315
317
    originalDbType = settings->getDatabaseType();
332
334
    for (int i=0; i<databaseType->count(); i++)
333
335
    {
334
336
        //kDebug(50003) << "Comparing comboboxentry on index ["<< i <<"] [" << databaseType->itemData(i)
335
 
          //            << "] with ["<< settings->getDatabaseType() << "]";
 
337
        //            << "] with ["<< settings->getDatabaseType() << "]";
336
338
        if (databaseType->itemData(i).toString() == settings->getDatabaseType())
337
339
        {
338
340
            databaseType->setCurrentIndex(i);
343
345
DatabaseParameters DatabaseWidget::getDatabaseParameters()
344
346
{
345
347
    DatabaseParameters parameters;
 
348
 
346
349
    if (currentDatabaseType() == QString(DatabaseParameters::SQLiteDatabaseType()) || !internalServer->isChecked())
347
350
    {
348
351
        parameters.connectOptions = connectionOptions->text();
368
371
        parameters = DatabaseParameters::defaultParameters(currentDatabaseType());
369
372
        DatabaseServerStarter::startServerManagerProcess(currentDatabaseType());
370
373
    }
 
374
 
371
375
    return parameters;
372
376
}
373
377