ok I did say to use QDesktopServices but treating contacts.csv is simpler
authorJohn Kern <johnk@symbian.org>
Thu, 12 Aug 2010 18:48:24 -0700
changeset 27 afa910b5ae81
parent 26 d9f0df25b6a3
child 28 7242cf5e2cd7
ok I did say to use QDesktopServices but treating contacts.csv is simpler
contactengine/contactengine.pro
contactengine/main.cpp
contactengine/resouce.qrc
--- a/contactengine/contactengine.pro	Thu Aug 12 17:06:22 2010 -0700
+++ b/contactengine/contactengine.pro	Thu Aug 12 18:48:24 2010 -0700
@@ -1,44 +1,47 @@
-#-------------------------------------------------
-#
-# Project created by QtCreator 2010-08-03T16:15:24
-#
-#-------------------------------------------------
-
-QT       += core gui sql
-
-TARGET = contactengine
-TEMPLATE = app
-
-CONFIG += debug
-
-SOURCES += main.cpp\
-        mainwindow.cpp \
-    contactsengine.cpp \
-    dbtools.cpp
-
-HEADERS  += mainwindow.h \
-    contactsengine.h \
-    database.h \
-    dbtools.h \
-    database.h
-
-
-FORMS    += mainwindow.ui
-
-CONFIG += mobility
-MOBILITY = contacts
-
-unix:INCLUDEPATH += /home/johnk/libs/include/QtContacts /home/johnk/libs/include/
-unix:LIBS += -L/home/johnk/libs/lib -lQtContacts
-
-databasefiles.sources = contacts.csv
-databasefiles.path = .
-
-DEPLOYMENT += databasefiles
-
-symbian {
-    TARGET.UID3 = 0xec200759
-    TARGET.CAPABILITY += ReadUserData WriteUserData
-    TARGET.EPOCSTACKSIZE = 0x14000
-    TARGET.EPOCHEAPSIZE = 0x020000 0x800000
-}
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-08-03T16:15:24
+#
+#-------------------------------------------------
+
+QT       += core gui
+
+TARGET = contactengine
+TEMPLATE = app
+
+CONFIG += debug
+
+SOURCES += main.cpp\
+        mainwindow.cpp \
+    contactsengine.cpp \
+    dbtools.cpp
+
+HEADERS  += mainwindow.h \
+    contactsengine.h \
+    database.h \
+    dbtools.h \
+    database.h
+
+
+FORMS    += mainwindow.ui
+
+CONFIG += mobility
+MOBILITY = contacts
+
+unix:INCLUDEPATH += /home/johnk/libs/include/QtContacts /home/johnk/libs/include/
+unix:LIBS += -L/home/johnk/libs/lib -lQtContacts
+
+databasefiles.sources = contacts.csv
+databasefiles.path = .
+
+DEPLOYMENT += databasefiles
+
+symbian {
+    TARGET.UID3 = 0xec200759
+    TARGET.CAPABILITY += ReadUserData WriteUserData
+    TARGET.EPOCSTACKSIZE = 0x14000
+    TARGET.EPOCHEAPSIZE = 0x020000 0x800000
+}
+
+RESOURCES += \
+    resouce.qrc
--- a/contactengine/main.cpp	Thu Aug 12 17:06:22 2010 -0700
+++ b/contactengine/main.cpp	Thu Aug 12 18:48:24 2010 -0700
@@ -11,16 +11,8 @@
     MainWindow w;
 
     DBTools dbt;
-    QString dbLocation;
+    QString dbLocation(":/contacts.csv");
 
-#ifdef Q_OS_SYMBIAN
-        dbLocation = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
-        dbLocation.append(QDir::separator());
-        dbLocation.append("contacts.csv");
-
-#else
-        dbLocation = "C:\\workspace\\QtExamples\\contactengine\\contacts.csv";
-#endif
     qDebug() << "dbLocation=" << dbLocation << endl;
     dbt.importCSV(dbLocation);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contactengine/resouce.qrc	Thu Aug 12 18:48:24 2010 -0700
@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/">
+        <file>contacts.csv</file>
+    </qresource>
+</RCC>