author | John Kern <johnk@symbian.org> |
Thu, 12 Aug 2010 17:06:22 -0700 | |
changeset 26 | d9f0df25b6a3 |
parent 24 | 2e833c2a6782 |
child 27 | afa910b5ae81 |
permissions | -rwxr-xr-x |
19
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
1 |
#include <QtGui/QApplication> |
24
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
2 |
#include <QDesktopServices> |
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
3 |
#include <QDir> |
19
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
4 |
#include "mainwindow.h" |
21
3bfc3227045d
CSV reader works, kind of. contacts.csv file added to project, must live in c:\ at the moment
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
19
diff
changeset
|
5 |
#include "dbtools.h" |
24
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
6 |
#include <QDebug> |
19
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
7 |
|
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
8 |
int main(int argc, char *argv[]) |
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
9 |
{ |
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
10 |
QApplication a(argc, argv); |
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
11 |
MainWindow w; |
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
12 |
|
21
3bfc3227045d
CSV reader works, kind of. contacts.csv file added to project, must live in c:\ at the moment
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
19
diff
changeset
|
13 |
DBTools dbt; |
24
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
14 |
QString dbLocation; |
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
15 |
|
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
16 |
#ifdef Q_OS_SYMBIAN |
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
17 |
dbLocation = QDesktopServices::storageLocation(QDesktopServices::DataLocation); |
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
18 |
dbLocation.append(QDir::separator()); |
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
19 |
dbLocation.append("contacts.csv"); |
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
20 |
|
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
21 |
#else |
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
22 |
dbLocation = "C:\\workspace\\QtExamples\\contactengine\\contacts.csv"; |
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
23 |
#endif |
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
24 |
qDebug() << "dbLocation=" << dbLocation << endl; |
2e833c2a6782
Added csv file to sis exports; improved csv file location in main.cpp
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
21
diff
changeset
|
25 |
dbt.importCSV(dbLocation); |
21
3bfc3227045d
CSV reader works, kind of. contacts.csv file added to project, must live in c:\ at the moment
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
19
diff
changeset
|
26 |
|
19
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
27 |
#if defined(Q_WS_S60) |
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
28 |
w.showMaximized(); |
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
29 |
#else |
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
30 |
w.show(); |
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
31 |
#endif |
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
32 |
|
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
33 |
return a.exec(); |
e4b6ee329501
WIP: first draft of contact engine
John Kern <johnk@symbian.org>
parents:
diff
changeset
|
34 |
} |