~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to kexi/kexidb/driver_p.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-09-21 15:36:35 UTC
  • mfrom: (1.4.1 upstream) (60.2.11 maverick)
  • Revision ID: james.westby@ubuntu.com-20100921153635-6tejqkiro2u21ydi
Tags: 1:2.2.2-0ubuntu3
Add kubuntu_03_fix-crash-on-closing-sqlite-connection-2.2.2.diff and
kubuntu_04_support-large-memo-values-for-msaccess-2.2.2.diff as
recommended by upstream http://kexi-
project.org/wiki/wikiview/index.php@Kexi2.2_Patches.html#sqlite_stab
ility

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
    Copyright (C) 2003-2007 Jarosław Staniek <staniek@kde.org>
 
3
    Copyright (C) 2004 Martin Ellis <martin.ellis@kdemail.net>
 
4
 
 
5
   This program is free software; you can redistribute it and/or
 
6
   modify it under the terms of the GNU Library General Public
 
7
   License as published by the Free Software Foundation; either
 
8
   version 2 of the License, or (at your option) any later version.
 
9
 
 
10
   This program is distributed in the hope that it will be useful,
 
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
   Library General Public License for more details.
 
14
 
 
15
   You should have received a copy of the GNU Library General Public License
 
16
   along with this program; see the file COPYING.  If not, write to
 
17
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
18
 * Boston, MA 02110-1301, USA.
 
19
*/
 
20
 
 
21
#include <KDebug>
 
22
#include <KLocale>
 
23
#include "driver_p.h"
 
24
 
 
25
using namespace KexiDB;
 
26
 
 
27
DriverPrivate::DriverPrivate()
 
28
        : isFileDriver(false)
 
29
        , isDBOpenedAfterCreate(false)
 
30
        , features(Driver::NoFeatures)
 
31
{
 
32
    adminTools = 0;
 
33
 
 
34
    properties["client_library_version"] = "";
 
35
    propertyCaptions["client_library_version"] =
 
36
        i18n("Client library version");
 
37
 
 
38
    properties["default_server_encoding"] = "";
 
39
    propertyCaptions["default_server_encoding"] =
 
40
        i18n("Default character encoding on server");
 
41
}
 
42
 
 
43
void DriverPrivate::initInternalProperties()
 
44
{
 
45
    properties["is_file_database"] = QVariant(isFileDriver);
 
46
    propertyCaptions["is_file_database"] = i18n("File-based database driver");
 
47
    if (isFileDriver) {
 
48
        properties["file_database_mimetype"] = fileDBDriverMimeType;
 
49
        propertyCaptions["file_database_mimetype"] = i18n("File-based database's MIME type");
 
50
    }
 
51
 
 
52
#if 0
 
53
    QString str;
 
54
    if (features & Driver::SingleTransactions)
 
55
        str = i18n("Single transactions");
 
56
    else if (features & Driver::MultipleTransactions)
 
57
        str = i18n("Multiple transactions");
 
58
    else if (features & Driver::NestedTransactions)
 
59
        str = i18n("Nested transactions");
 
60
    else if (features & Driver::IgnoreTransactions)
 
61
        str = i18n("Ignored");
 
62
    else
 
63
        str = i18n("None");
 
64
#endif
 
65
// properties["transaction_support"] = features & Driver::TransactionsMask;
 
66
// propertyCaptions["transaction_support"] = i18n("Transaction support");
 
67
    properties["transaction_single"] = QVariant(features & Driver::SingleTransactions);
 
68
    propertyCaptions["transaction_single"] = i18n("Single transactions support");
 
69
    properties["transaction_multiple"] = QVariant(features & Driver::MultipleTransactions);
 
70
    propertyCaptions["transaction_multiple"] = i18n("Multiple transactions support");
 
71
    properties["transaction_nested"] = QVariant(features & Driver::NestedTransactions);
 
72
    propertyCaptions["transaction_nested"] = i18n("Nested transactions support");
 
73
 
 
74
    properties["kexidb_driver_version"] =
 
75
        QString("%1.%2").arg(version().major).arg(version().minor);
 
76
    propertyCaptions["kexidb_driver_version"] =
 
77
        i18n("KexiDB driver version");
 
78
}
 
79
 
 
80
DriverPrivate::~DriverPrivate()
 
81
{
 
82
    delete adminTools;
 
83
}
 
84
 
 
85
//--------------------------
 
86
 
 
87
AdminTools::Private::Private()
 
88
{
 
89
}
 
90
 
 
91
AdminTools::Private::~Private()
 
92
{
 
93
}