Commit 099493d6 authored by Dimitrios T. Tanis's avatar Dimitrios T. Tanis Committed by Jarosław Staniek

Show message when no database server drivers are found

When trying to create/open/import a project that requires a database server
driver, if none is found display a message informing about it and giving
general instructions what to do.

(+behaviour improved by J. Staniek)

REVIEW:107100
BUG:131092
parent 301d33e7
/* This file is part of the KDE project
Copyright (C) 2004-2012 Jarosław Staniek <staniek@kde.org>
Copyright (C) 2012 Dimitrios T. Tanis <dimitrios.tanis@kdemail.net>
Contains code from KConfigGroupPrivate from kconfiggroup.cpp (kdelibs 4)
Copyright (c) 2006 Thomas Braxton <brax108@cox.net>
......@@ -1666,6 +1667,18 @@ bool KexiDB::importSqliteFile(const QString &inputFileName, const QString &outpu
return true;
}
bool KexiDB::hasDatabaseServerDrivers()
{
DriverManager manager;
Driver::InfoHash driversInfo = manager.driversInfo();
foreach(const Driver::Info& info, driversInfo){
if (!info.fileBased) {
return true;
}
}
return false;
}
//--------------------------------------------------------------------------------
#ifdef CALLIGRADB_DEBUG_GUI
......
/* This file is part of the KDE project
Copyright (C) 2004-2012 Jarosław Staniek <staniek@kde.org>
Copyright (C) 2012 Dimitrios T. Tanis <dimitrios.tanis@kdemail.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
......@@ -579,6 +580,9 @@ CALLIGRADB_EXPORT QString sqlite3ProgramPath();
@return true on success. */
CALLIGRADB_EXPORT bool importSqliteFile(const QString &inputFileName, const QString &outputFileName);
/*! @return true if there is at least one server-based database driver installed. */
CALLIGRADB_EXPORT bool hasDatabaseServerDrivers();
#ifdef CALLIGRADB_DEBUG_GUI
typedef void(*DebugGUIHandler)(const QString&);
CALLIGRADB_EXPORT void setDebugGUIHandler(DebugGUIHandler handler);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment