From acf481748bb6f23fcdef4b121e593bb1693b49d5 Mon Sep 17 00:00:00 2001
From: Treeve Jelbert <treeve@sourcemage.org>
Date: Wed, 3 Jun 2015 17:20:47 +0200
Subject: [PATCH] fixes for qt-5.5, icu-55.1, gcc-5.1

---
 src/drivers/sqlite/icu/icu.c   | 4 ++++
 src/tools/KDbUtils.cpp         | 1 +
 src/views/KDbTableViewData.cpp | 8 ++++----
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/drivers/sqlite/icu/icu.c b/src/drivers/sqlite/icu/icu.c
index e8fc257..2689c70 100644
--- a/src/drivers/sqlite/icu/icu.c
+++ b/src/drivers/sqlite/icu/icu.c
@@ -37,6 +37,10 @@
 #include <unicode/uregex.h>
 #include <unicode/ustring.h>
 #include <unicode/ucol.h>
+#include <unicode/uvernum.h>
+#if U_ICU_VERSION_MAJOR_NUM>=51
+#include <unicode/utf_old.h>
+#endif
 
 #include <assert.h>
 
diff --git a/src/tools/KDbUtils.cpp b/src/tools/KDbUtils.cpp
index 3dd95dd..179827e 100644
--- a/src/tools/KDbUtils.cpp
+++ b/src/tools/KDbUtils.cpp
@@ -33,6 +33,7 @@
 #include "kdb_debug.h"
 
 #include <QRegExp>
+#include <QDataStream>
 #include <QDir>
 #include <QFile>
 #include <QFileInfo>
diff --git a/src/views/KDbTableViewData.cpp b/src/views/KDbTableViewData.cpp
index 5bdaf7a..cf72b63 100644
--- a/src/views/KDbTableViewData.cpp
+++ b/src/views/KDbTableViewData.cpp
@@ -49,7 +49,7 @@ class CollatorInstance
 public:
     CollatorInstance() {
         UErrorCode status = U_ZERO_ERROR;
-        m_collator = Collator::createInstance(status);
+        m_collator = icu::Collator::createInstance(status);
         if (U_FAILURE(status)) {
             kdbWarning() << "Could not create instance of collator:" << status;
             m_collator = 0;
@@ -62,7 +62,7 @@ public:
         }
     }
 
-    Collator* getCollator() {
+    icu::Collator* getCollator() {
         return m_collator;
     }
 
@@ -71,7 +71,7 @@ public:
     }
 
 private:
-    Collator *m_collator;
+    icu::Collator *m_collator;
 };
 
 Q_GLOBAL_STATIC(CollatorInstance, KDb_collator)
@@ -157,7 +157,7 @@ private:
     static bool cmpStringWithCollator(const QVariant& left, const QVariant& right) {
         const QString &as = left.toString();
         const QString &bs = right.toString();
-        return Collator::LESS == KDb_collator->getCollator()->compare(
+        return icu::Collator::LESS == KDb_collator->getCollator()->compare(
                                         (const UChar *)as.constData(), as.size(),
                                         (const UChar *)bs.constData(), bs.size());
     }
-- 
2.4.1

