File indexing completed on 2024-04-14 15:05:40
0001 /* 0002 * Copyright (C) 2011 Stefano Sanfilippo <stefano.k.sanfilippo@gmail.com> 0003 * 0004 * This library is free software; you can redistribute it and/or modify 0005 * it under the terms of the GNU Lesser General Public License as published 0006 * by the Free Software Foundation; either version 2.1 of the License, or 0007 * (at your option) any later version. 0008 * 0009 * This program is distributed in the hope that it will be useful, 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0012 * GNU General Public License for more details. 0013 * 0014 * You should have received a copy of the GNU Lesser General Public License 0015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0016 */ 0017 0018 //#include <TelepathyQt4Logger/Log> 0019 #include <QGlib/Error> 0020 0021 #include <QApplication> 0022 #include <QtCore/QDebug> 0023 0024 //using namespace Tpl; 0025 0026 int main(int argc, char **argv) 0027 { 0028 QApplication app(argc, argv); 0029 //Tpl::Debug e; 0030 0031 if (argc < 3) { 0032 qWarning("Must specify a dbus object path as first parameter, and a search term as second!\n"); 0033 exit(0); 0034 } 0035 0036 try { 0037 // Query objects must be declared in same block as QueryMainLoop 0038 // (as they will return const refs) 0039 //ChatExistsQuery q1(argv[1]); 0040 //ConversationDatesQuery q2(argv[1]); 0041 //MessagesForDateQuery q3(argv[1]); 0042 //KeywordQuery q4(argv[1]); 0043 //ChatsForAccountQuery q5(argv[1]); 0044 0045 // Debugging/Example connections 0046 //QObject::connect(&q1, SIGNAL(completed(bool)), &e, SLOT(echo(bool))); 0047 //QObject::connect(&q2, SIGNAL(completed(QList<QDate>)), &e, SLOT(echo(QList<QDate>))); 0048 //QObject::connect(&q3, SIGNAL(completed(QList<Entry>)), &e, SLOT(echo(QList<Entry>))); 0049 //QObject::connect(&q4, SIGNAL(completed(QList<SearchHit>)), &e, SLOT(echo(QList<SearchHit>))); 0050 //QObject::connect(&q5, SIGNAL(completed(QList<Entity>)), &e, SLOT(echo(QList<Entity>))); 0051 0052 // Perform all queries... 0053 //q1.perform(argv[2], true); 0054 //q2.perform(argv[2], true); 0055 //q3.perform(argv[2], true); 0056 //q4.perform(argv[2]); 0057 //q5.perform(); 0058 0059 // Run main loop... 0060 return app.exec(); 0061 0062 } catch (const QGlib::Error &e) { 0063 //qDebug() << e.message(); 0064 exit(1); 0065 } 0066 0067 return -1; 0068 }