]> vaikene.ee Git - evaf/commitdiff
Merge branch 'master' of ssh://vaikene.net/var/gitpub/evaf
authorEnar Väikene <enar@vaikene.net>
Tue, 5 Jun 2012 06:23:10 +0000 (09:23 +0300)
committerEnar Väikene <enar@vaikene.net>
Tue, 5 Jun 2012 06:23:10 +0000 (09:23 +0300)
28 files changed:
CMakeWin.txt
src/apps/FileFinder/Engine/CMakeLists.txt
src/apps/FileFinder/GUI/CMakeLists.txt
src/apps/PswGen/CLI/CMakeLists.txt
src/apps/PswGen/CLI/cli.cpp
src/apps/PswGen/CLI/version.h
src/apps/PswGen/GUI/CMakeLists.txt
src/apps/PswGen/GUI/gui.cpp
src/apps/PswGen/GUI/gui.h
src/apps/PswGen/GUI/version.h
src/apps/PswGen/Generator/CMakeLists.txt
src/apps/PswGen/Generator/module.cpp
src/apps/PswGen/Generator/version.h
src/apps/PswGen/Storage/CMakeLists.txt
src/apps/PswGen/Storage/istorage.h
src/apps/PswGen/Storage/module.cpp
src/apps/PswGen/Storage/module.h
src/apps/PswGen/Storage/version.h
src/libs/Common/CMakeLists.txt
src/libs/Common/logger.cpp
src/libs/Gui/CMakeLists.txt
src/libs/Plugins/CMakeLists.txt
src/libs/Plugins/pluginmanager.h
src/main/CLI/CMakeLists.txt
src/main/GUI/CMakeLists.txt
src/plugins/LogView/CMakeLists.txt
src/plugins/SdiWindow/CMakeLists.txt
src/plugins/Test/CMakeLists.txt

index 6e43b9a281c7ac6150de2993f117d177095023dd..95a950035199fc4e77238e5991929cc34c0bdc39 100644 (file)
@@ -1,3 +1,18 @@
 # Extra rules for Windows builds
 
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t-")
+if(MINGW)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+
+    # gcc options for release and debug builds
+    IF(CMAKE_BUILD_TYPE STREQUAL Release)
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
+    ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
+    ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
+
+    set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
+
+else(MINGW)
+    # Assume a Microsoft Visual C++ compiler
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t-")
+endif(MINGW)
index 4e9e9ba8cdff6d81dd3a30b9c1b8151cba8e72b2..af9c24a7bebc6785f29a30eeb8d59a7d1df17c40 100644 (file)
@@ -26,9 +26,9 @@ set(MOC_HDRS
 )
 
 # Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
 
 qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
 
index cdc585fab82979f0964e65aace12e639dd50b09f..56b5db42eab939034fef713301928b53200da9bb 100644 (file)
@@ -26,9 +26,9 @@ set(MOC_HDRS
 #)
 
 # Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
 
 qt4_add_resources(RCC_SRCS ${RCCS})
 
index 63f57a77e2dfe8ed28f63c31e2a4c6ba34e01ba4..ef8ee227b25460bc7df9638cce94fb5f0f8aaf1e 100644 (file)
@@ -22,9 +22,9 @@ set(MOC_HDRS
 )
 
 # Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
 
 qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
 
index cd18b852b7f096660a5ac1ecf6130b12242d4f11..51ea2b6690351cafa0dc2f654156a856fd2a03b8 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Command line interface for the PswGen application
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2012 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
@@ -29,6 +29,7 @@
 #include <Common/iEventQueue>
 #include <Common/iApp>
 #include <Common/Event>
+#include <Common/Util>
 
 #include <QtCore>
 
@@ -159,7 +160,10 @@ void Module::generatePassword()
 {
     QString masterPassword;
     QString appName;
+    QString suffix;
     int passwordLength = 0;
+    uint flags = 0;
+    int alnum = -1;
 
     // Process command-line arguments
     QStringList args = QCoreApplication::arguments();
@@ -170,6 +174,18 @@ void Module::generatePassword()
             masterPassword = arg.at(1);
         else if (QRegExp("-[-]?n(ame)?").exactMatch(arg.at(0)) && arg.size() > 1)
             appName = arg.at(1);
+        else if (QRegExp("-[-]?s(uffix)?").exactMatch(arg.at(0)) && arg.size() > 1)
+            suffix = arg.at(1);
+        else if (QRegExp("-[-]?a(lphanumeric)?").exactMatch(arg.at(0))) {
+            if (arg.size() > 1) {
+                if (Common::isTrue(arg.at(1)))
+                    alnum = 1;
+                else if (Common::isFalse(arg.at(1)))
+                    alnum = 0;
+            }
+            else
+                alnum = 1;
+        }
         else if (QRegExp("-[-]?l(ength)?").exactMatch(arg.at(0)) && arg.size() > 1) {
             bool ok;
             int t = arg.at(1).toInt(&ok);
@@ -181,6 +197,14 @@ void Module::generatePassword()
         }
     }
 
+    // Set flags
+    if (alnum != -1) {
+        if (alnum == 1)
+            flags |= uint(iGenerator::ALPHANUMERIC);
+        else
+            flags &= ~uint(iGenerator::ALPHANUMERIC);
+    }
+
     QTextStream cin(stdin);
     QTextStream cout(stdout);
 
@@ -199,8 +223,14 @@ void Module::generatePassword()
     QExplicitlySharedDataPointer<PswGen::Storage::Data> data;
     if (mStorage) {
         data = mStorage->query(appName);
-        if (data && passwordLength == 0)
-            passwordLength = data->length();
+        if (data) {
+            if (passwordLength == 0)
+                passwordLength = data->length();
+            if (suffix.isEmpty())
+                suffix = data->suffix();
+            if (alnum == -1)
+                flags = data->flags();
+        }
     }
 
     // If the length argument is still not initialized, use the default length value
@@ -208,15 +238,17 @@ void Module::generatePassword()
         passwordLength = DefaultPasswordLength;
 
     // Generate password
-    QString password = mGenerator->generatePassword(appName, masterPassword, passwordLength);
+    QString password = mGenerator->generatePassword(appName + suffix, masterPassword, passwordLength);
     cout << "Generated password : " << password << endl;
 
     // Store arguments for this password
     if (mStorage) {
         if (!data)
-            data = new Storage::Data(appName, passwordLength);
-        else
+            data = new Storage::Data(appName, suffix, passwordLength);
+        else {
+            data->setSuffix(suffix);
             data->setLength(passwordLength);
+        }
         mStorage->save(appName, data);
     }
 }
index 348e78a6b48b81057eeb9938c01edfd49432f0f8..eb872f513921e7c71eeaab3914090057dc81b624 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Version information for eVaf modules
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2012 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
 /**
  * Module/library version number in the form major,minor,release,build
  */
-#define VER_FILE_VERSION                0,1,1,2
+#define VER_FILE_VERSION                0,2,1,3
 
 /**
  * Module/library version number in the string format (shall end with \0)
  */
-#define VER_FILE_VERSION_STR            "0.1.1.2\0"
+#define VER_FILE_VERSION_STR            "0.2.1.3\0"
 
 /**
  * Module/library name (shall end with \0)
index bea3cd6ee1dc939737f84a78cc6b8a716394604c..561060ec6898ac85241e031cd804784a53c9e892 100644 (file)
@@ -21,9 +21,9 @@ set(MOC_HDRS
 )
 
 # Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
 
 qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
 
index 1ced109fa27cb869ec691d7568d3c0378dd8cb79..9ab2645b9bb745b5aa61ab95bbb0a5a8beecb64c 100644 (file)
@@ -3,7 +3,7 @@
  * @brief GUI for the PswGen application
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2012 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
@@ -111,24 +111,35 @@ bool Module::init(QString const & args)
     g->addWidget(wName, 1, 1, 1, 2);
     panel->setFocusProxy(wName);
 
-    l = new QLabel(tr("&Length of the password:", VER_MODULE_NAME_STR));
+    l = new QLabel(tr("&Suffix:", VER_MODULE_NAME_STR));
     l->setAlignment(Qt::AlignRight);
     g->addWidget(l, 2, 0);
 
+    wSuffix = new QLineEdit;
+    l->setBuddy(wSuffix);
+    g->addWidget(wSuffix, 2, 1, 1, 2);
+
+    l = new QLabel(tr("&Length of the password:", VER_MODULE_NAME_STR));
+    l->setAlignment(Qt::AlignRight);
+    g->addWidget(l, 3, 0);
+
     wLength = new QSpinBox;
     l->setBuddy(wLength);
     wLength->setRange(0, mGenerator->maxLength());
     wLength->setValue(DefaultPasswordLength);
     wLength->setSpecialValueText(tr("Maximum", VER_MODULE_NAME_STR));
-    g->addWidget(wLength, 2, 1);
+    g->addWidget(wLength, 3, 1);
+
+    wAlNum = new QCheckBox(tr("&Alpha-Numeric only", VER_MODULE_NAME_STR));
+    g->addWidget(wAlNum, 3, 2);
 
     l = new QLabel(tr("Password:"));
     l->setAlignment(Qt::AlignRight);
-    g->addWidget(l, 3, 0);
+    g->addWidget(l, 4, 0);
 
     wPassword = new QLineEdit;
     wPassword->setReadOnly(true);
-    g->addWidget(wPassword, 3, 1, 1, 2);
+    g->addWidget(wPassword, 4, 1, 1, 2);
 
     v->addStretch();
 
@@ -176,8 +187,11 @@ void Module::textChanged(QString const &)
     wGenerate->setDisabled(wMasterPassword->text().isEmpty() || wName->text().isEmpty());
     if (!wName->text().isEmpty() && mStorage) {
         QExplicitlySharedDataPointer<PswGen::Storage::Data> data = mStorage->query(wName->text());
-        if (data)
+        if (data) {
             wLength->setValue(data->length());
+            wSuffix->setText(data->suffix());
+            wAlNum->setChecked(data->flags() & uint(iGenerator::ALPHANUMERIC));
+        }
     }
 }
 
@@ -185,14 +199,27 @@ void Module::generateClicked()
 {
     if (wMasterPassword->text().isEmpty() || wName->text().isEmpty())
         return;
-    wPassword->setText(mGenerator->generatePassword(wName->text(), wMasterPassword->text(), wLength->value()));
+    uint flags = 0;
+    if (wAlNum->isChecked())
+        flags |= iGenerator::ALPHANUMERIC;
+    wPassword->setText(mGenerator->generatePassword(wName->text() + wSuffix->text(),
+                                                    wMasterPassword->text(),
+                                                    wLength->value(),
+                                                    flags));
     wCopy->setEnabled(true);
     if (mStorage) {
         QExplicitlySharedDataPointer<PswGen::Storage::Data> data = mStorage->query(wName->text());
-        if (!data)
-            data = new Storage::Data(wName->text(), wLength->value());
-        else
+        if (!data) {
+            data = new Storage::Data(wName->text(), wSuffix->text(), wLength->value());
+        }
+        else {
+            data->setSuffix(wSuffix->text());
             data->setLength(wLength->value());
+            if (wAlNum->isChecked())
+                data->setFlags(data->flags() | iGenerator::ALPHANUMERIC);
+            else
+                data->setFlags(data->flags() & ~uint(iGenerator::ALPHANUMERIC));
+        }
         mStorage->save(wName->text(), data);
     }
 }
index d3c89d4abf0e54d0c7b609b3bf9f3b97fadd4b27..246b556ac6c37a038920ef8e5052ce6f70e00c1b 100644 (file)
@@ -3,7 +3,7 @@
  * @brief GUI for the PswGen application
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2012 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
@@ -28,6 +28,7 @@
 class QLineEdit;
 class QSpinBox;
 class QPushButton;
+class QCheckBox;
 
 namespace eVaf {
 namespace PswGen {
@@ -84,9 +85,11 @@ private: // Members
     eVaf::PswGen::iStorage * mStorage;
 
     /// Widgets on the screen
-    QLineEdit * wName;
     QLineEdit * wMasterPassword;
+    QLineEdit * wName;
+    QLineEdit * wSuffix;
     QSpinBox * wLength;
+    QCheckBox * wAlNum;
     QLineEdit * wPassword;
     QPushButton * wGenerate;
     QPushButton * wCopy;
index 8f3e970ab521a83ceaf022a92755ab5f1f58dda7..b9003fd0fcf5943921eb2389caf93e66fa598466 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Version information for eVaf modules
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2012 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
 /**
  * Module/library version number in the form major,minor,release,build
  */
-#define VER_FILE_VERSION                0,1,5,6
+#define VER_FILE_VERSION                0,2,1,7
 
 /**
  * Module/library version number in the string format (shall end with \0)
  */
-#define VER_FILE_VERSION_STR            "0.1.5.6\0"
+#define VER_FILE_VERSION_STR            "0.2.1.7\0"
 
 /**
  * Module/library name (shall end with \0)
index 9325fe95dba1965003a34a7d5b9e644fc018b284..3d7c7ebe514aea2d68153a65fddab79a4fbc7c9e 100644 (file)
@@ -25,9 +25,9 @@ set(MOC_HDRS
 )
 
 # Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
 
 qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
 
index e19933ba4ed8c1fe30599ec6a572aa313a50cdb2..9e24e561f39d16d317ab6b2371694366a393dd3c 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Implementation of the iGenerator interface
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2012 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
@@ -94,7 +94,17 @@ QString GeneratorImpl::generatePassword(QString const & name, QString const & ma
     hash.addData(inputString);
     QByteArray result = hash.result().toBase64();
     if (length > 0)
-        return result.left(length);
-    else
-        return result;
+        result.resize(length);
+
+    if (flags & uint(ALPHANUMERIC)) {
+        // Convert all characters to alpha-numeric
+        for (int i = 0; i < result.size(); ++i) {
+            unsigned char c = result.at(i);
+            while (isalnum(c) == 0)
+                c++;
+            result[i] = c;
+        }
+    }
+
+    return result;
 }
index b118cdca85d5f4de4c0398239a5756f72474a172..c2e78d034ed2614a1d96114161d3429e9203ae5b 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Version information for eVaf modules
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2012 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
 /**
  * Module/library version number in the form major,minor,release,build
  */
-#define VER_FILE_VERSION                0,1,1,1
+#define VER_FILE_VERSION                0,1,2,2
 
 /**
  * Module/library version number in the string format (shall end with \0)
  */
-#define VER_FILE_VERSION_STR            "0.1.1.1\0"
+#define VER_FILE_VERSION_STR            "0.1.2.2\0"
 
 /**
  * Module/library name (shall end with \0)
index 13722c39e4b49c8e1956d270bbf63eb9c3e8d034..2169469e2613cc63b7baf1a8d37a720a62b549c0 100644 (file)
@@ -26,9 +26,9 @@ set(MOC_HDRS
 )
 
 # Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
 
 qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
 
index 48226d0ec7a6d66b18c2d1ab7171e991b01c7968..e9abef95850f773a72f147630d5f45aa6cf7768b 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Interface for password storage modules
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2012 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
@@ -43,14 +43,16 @@ public:
         : QSharedData()
         , mModified(false)
         , mName(name)
+        , mSuffix()
         , mLength(0)
         , mFlags(0)
     {}
 
-    Data(QString const & name, int l, uint f = 0)
+    Data(QString const & name, QString const & suffix, int l, uint f = 0)
         : QSharedData()
         , mModified(false)
         , mName(name)
+        , mSuffix(suffix)
         , mLength(l)
         , mFlags(f)
     {}
@@ -58,6 +60,16 @@ public:
     /// Name of the password
     inline QString const & name() const { return mName; }
 
+    /// Optional suffix added to the name
+    inline QString const & suffix() const { return mSuffix; }
+    void setSuffix(QString const & suffix)
+    {
+        if (suffix != mSuffix) {
+            mSuffix = suffix;
+            mModified = true;
+        }
+    }
+
     /// Length of the generated password
     inline int length() const { return mLength; }
     inline void setLength(int value)
@@ -89,6 +101,7 @@ private:
 
     bool mModified;
     QString mName;
+    QString mSuffix;
     int mLength;
     uint mFlags;
 
index b7676abf282f0d1323855a54919a676048619a43..12fda4213118132b30768af23720beb78cfbd5bd 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Implementation of the iStorage interface
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2012 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
@@ -150,8 +150,8 @@ bool StorageImpl::save(QString const & name, QExplicitlySharedDataPointer<Storag
         // This is an update
         if (data->modified()) {
             QSqlQuery q(mDb);
-            if (!q.exec(QString("UPDATE data SET length = \'%1\', flags = \'%2\' WHERE name = \'%3\';")
-                            .arg(data->length()).arg(data->flags()).arg(name))) {
+            if (!q.exec(QString("UPDATE data SET suffix = \'%1\', length = \'%2\', flags = \'%3\' WHERE name = \'%4\';")
+                            .arg(data->suffix()).arg(data->length()).arg(data->flags()).arg(name))) {
                 QSqlError err = mDb.lastError();
                 EVAF_ERROR("Failed to update \'%s\' : %s", qPrintable(name), qPrintable(err.text()));
                 return false;
@@ -161,8 +161,8 @@ bool StorageImpl::save(QString const & name, QExplicitlySharedDataPointer<Storag
     else {
         // Store to the database
         QSqlQuery q(mDb);
-        if (!q.exec(QString("INSERT INTO data (name, length, flags) VALUES (\'%1\', %2, %3);")
-                            .arg(name).arg(data->length())
+        if (!q.exec(QString("INSERT INTO data (name, suffix, length, flags) VALUES (\'%1\', \'%2\', %3, %4);")
+                            .arg(name).arg(data->suffix()).arg(data->length())
                             .arg(int(data->flags())))) {
             QSqlError err = mDb.lastError();
             EVAF_ERROR("Failed to insert \'%s\' : %s", qPrintable(name), qPrintable(err.text()));
@@ -210,11 +210,13 @@ bool StorageImpl::createTables()
         return false;
     }
 
-    if (q.isActive() && q.isSelect() && q.first())
-        return true; // We already have a table called 'data'
+    if (q.isActive() && q.isSelect() && q.first()) {
+        // Check if the table needs to be upgraded
+        return upgradeTables();
+    }
 
     // Create the 'data' table
-    if (!q.exec("CREATE TABLE data (name text primary key not null, length integer, flags integer);")) {
+    if (!q.exec("CREATE TABLE data (name text primary key not null, suffix text, length integer, flags integer);")) {
         QSqlError err = mDb.lastError();
         EVAF_ERROR("Failed to create table \'data\' : %s", qPrintable(err.text()));
         return false;
@@ -223,10 +225,29 @@ bool StorageImpl::createTables()
     return true;
 }
 
+bool StorageImpl::upgradeTables()
+{
+    QSqlQuery q(mDb);
+
+    // Check if the 'suffix' column exists
+    if (q.exec("SELECT suffix from data;")) {
+        return true;
+    }
+
+    // Add the 'suffix' columnt
+    if (!q.exec("ALTER TABLE data ADD COLUMN suffix TEXT;")) {
+        QSqlError err = mDb.lastError();
+        EVAF_ERROR("Failed to upgrade table \'data\' : %s", qPrintable(err.text()));
+        return false;
+    }
+
+    return true;
+}
+
 bool StorageImpl::loadData()
 {
     QSqlQuery q(mDb);
-    if (!q.exec("SELECT name, length, flags FROM data;")) {
+    if (!q.exec("SELECT name, suffix, length, flags FROM data;")) {
         QSqlError err = mDb.lastError();
         EVAF_ERROR("Failed to query database : %s", qPrintable(err.text()));
         return false;
@@ -234,7 +255,8 @@ bool StorageImpl::loadData()
 
     while (q.next()) {
         QString name = q.value(0).toString();
-        QExplicitlySharedDataPointer<Storage::Data> data(new Storage::Data(name, q.value(1).toInt(), uint(q.value(2).toInt())));
+        QExplicitlySharedDataPointer<Storage::Data> data(
+                    new Storage::Data(name, q.value(1).toString(), q.value(2).toInt(), uint(q.value(3).toInt())));
         mData.insert(name, data);
     }
 
index 95b935f2926bec0e31793eba401d7d7668c4fbd4..7f53b268d23718b04d65d828a79ce9fbdf998337 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Implementation of the iStorage interface
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2012 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
@@ -139,6 +139,16 @@ private: // Methods
      */
     bool createTables();
 
+    /**
+     * Upgrades database tables if necessary
+     * @return True if ok; false if failed
+     *
+     * This function checks if database tables need to upgraded and
+     * performs the upgrade without a loss of data if possible.
+     * Returns false if upgrade is not possible or fails.
+     */
+    bool upgradeTables();
+
     /**
      * Loads data from the database
      * @return True if ok; false if failed
index 2712b3680a1efc87efb04f3321cb3c1c25c0980f..cbcf67f9b63218b70da26abf4cc414c251c4761c 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Version information for eVaf modules
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2012 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
 /**
  * Module/library version number in the form major,minor,release,build
  */
-#define VER_FILE_VERSION                0,1,2,2
+#define VER_FILE_VERSION                0,2,1,3
 
 /**
  * Module/library version number in the string format (shall end with \0)
  */
-#define VER_FILE_VERSION_STR            "0.1.2.2\0"
+#define VER_FILE_VERSION_STR            "0.2.1.3\0"
 
 /**
  * Module/library name (shall end with \0)
index a9916b4b4dcd9d957632c78045be30d8070ca7ed..83affd4f2c5130191a4136f76a948bd08efeeb64 100644 (file)
@@ -45,9 +45,9 @@ set(MOC_HDRS
 )
 
 # Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
 
 qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
 
index bb8807395aa7c735c07972a9a94110d1fae209df..358b3146b3bb6e789670adc1203d0524956de764 100644 (file)
@@ -421,7 +421,11 @@ QString Logger::printf(char const * const fmt, ...) const
     va_list ap;
 #ifdef Q_OS_WIN32
     va_start(ap, fmt);
+#  ifdef Q_CC_GNU
+    vsnprintf(str, sizeof(str), fmt, ap);
+#  else
     _vsnprintf_s(str, sizeof(str), _TRUNCATE, fmt, ap);
+#  endif
     va_end(ap);
 #else
     ::va_start(ap, fmt);
index 19fd17239bb3c6e0f44bc419d8cb18609efd0f1e..8821dc1cbf40f2af6141de7ebd8e55bf7c16304f 100644 (file)
@@ -24,9 +24,9 @@ set(MOC_HDRS
 )
 
 # Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
 
 qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
 
index 0aadd65e8ecbbe13eb7cc8999582469732a0c187..edcfae664d4f74cec71c1c7afc11c55377d21003 100644 (file)
@@ -29,9 +29,9 @@ set(MOC_HDRS
 )
 
 # Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
 
 qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
 
index f79193c1ab89034575fea35550a4d63456be0884..c9806af14eda1916b3331612eeb1cacdb1997947 100644 (file)
@@ -58,7 +58,11 @@ namespace Internal {
 inline QString expandPluginName(QString const & name)
 {
 #ifdef Q_OS_WIN32
+#  ifdef Q_CC_MINGW
+    return "lib" + name + ".dll";
+#  else
     return name + ".dll";
+#  endif
 #elif defined Q_OS_LINUX
     return "lib" + name + ".so";
 #else
index d6a5b14cb679368029eb45c0326743325f84d3f3..a3983a6fb3e45e982329054a1af202f4ac903ca9 100644 (file)
@@ -23,9 +23,9 @@ set(MOC_HDRS
 )
 
 # Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     set(SRCS ${SRCS} version.rc cli.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
 
 qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
 
index 8483bb57cb6b03f231e485db8ad785ded3b80e78..367e2f53a1c61cb24b865900a735220b9126d261 100644 (file)
@@ -38,9 +38,9 @@ set(MOC_HDRS
 #)
 
 # Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     set(SRCS ${SRCS} version.rc gui.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
 
 qt4_add_resources(RCC_SRCS ${RCCS})
 
index 8f68dd18c712bd2b30c94040b7fc0b7021b65b86..ac0d07f98fdf19a7bb111ae4047912b83b25f83e 100644 (file)
@@ -26,9 +26,9 @@ set(MOC_HDRS
 )
 
 # Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
 
 qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
 
index c87eed6d6cd2dfaa75f085ff2887abaac6b53834..cd0a8c01829a59f639edbb3c4c398177bacb4c39 100644 (file)
@@ -26,9 +26,9 @@ set(MOC_HDRS
 )
 
 # Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
 
 qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})
 
index 35393d748260a1514c0b6cccb13c31bd647635a2..bbf03ba17fb1bc698fe00e6d82d2f2a10a92e750 100644 (file)
@@ -23,9 +23,9 @@ set(MOC_HDRS
 )
 
 # Version info resource file for Windows builds
-if(WIN32)
+if(WIN32 AND NOT MINGW)
     set(SRCS ${SRCS} version.rc)
-endif(WIN32)
+endif(WIN32 AND NOT MINGW)
 
 qt4_wrap_cpp(MOC_SRCS ${MOC_HDRS})