From de9a7ec6b70c796182e0a7992aa380a58b954b94 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Fri, 31 Aug 2007 14:02:55 +0000 Subject: [PATCH] First check-in of the Qtopia build system. See qtopia-build/README. Yes, this compiles and links an example application (that includes all quassel parts intended for Qtopia). Nope, it does not display more than a button, since the main() is still the one from the Qtopia example app. And yes, this has hardly been tested and will probably be redesigned at some point. But it's still a proof of concept :) --- qtopia-build/README | 14 ++++++++ qtopia-build/qtopia.pro | 18 +++++++++++ src/client/client.cpp | 1 - src/client/client.pro | 2 ++ src/common/common.pro | 2 ++ src/common/ircuser.cpp | 3 +- src/common/message.h | 5 ++- src/contrib/qxt/qxt.pro | 2 ++ src/contrib/qxt/qxtboundfunction.h | 2 +- src/core/core.cpp | 1 + src/qtgui/mainwin.cpp | 6 ++-- src/qtopia/example.cpp | 52 ++++++++++++++++++++++++++++++ src/qtopia/example.desktop | 10 ++++++ src/qtopia/example.h | 36 +++++++++++++++++++++ src/qtopia/examplebase.ui | 44 +++++++++++++++++++++++++ src/qtopia/main.cpp | 19 +++++++++++ src/qtopia/qtopia.pro | 4 +++ 17 files changed, 212 insertions(+), 9 deletions(-) create mode 100644 qtopia-build/README create mode 100644 qtopia-build/qtopia.pro create mode 100644 src/client/client.pro create mode 100644 src/common/common.pro create mode 100644 src/contrib/qxt/qxt.pro create mode 100644 src/qtopia/example.cpp create mode 100644 src/qtopia/example.desktop create mode 100644 src/qtopia/example.h create mode 100644 src/qtopia/examplebase.ui create mode 100644 src/qtopia/main.cpp create mode 100644 src/qtopia/qtopia.pro diff --git a/qtopia-build/README b/qtopia-build/README new file mode 100644 index 00000000..5e8d23b5 --- /dev/null +++ b/qtopia-build/README @@ -0,0 +1,14 @@ +# Configure for x86 (emulator) or greenphone: +gph -C x86 OR gph -C greenphone + +# Create Makefiles: +qtopiamake + +# Build: +make + +# Create Packages: +gph -p + +# Run: +gph -r diff --git a/qtopia-build/qtopia.pro b/qtopia-build/qtopia.pro new file mode 100644 index 00000000..bb4a36f8 --- /dev/null +++ b/qtopia-build/qtopia.pro @@ -0,0 +1,18 @@ +qtopia_project(qtopia app) + +TARGET=quasseltopia +CONFIG+=qtopia_main no_quicklaunch + +# Find files +INCLUDEPATH+=../src/qtopia ../src/client ../src/common ../src/contrib/qxt + + +# Include .pro from src dirs +include(../src/contrib/qxt/qxt.pro) +include(../src/common/common.pro) +include(../src/qtopia/qtopia.pro) +include(../src/client/client.pro) + +# SXE permissions required +pkg.domain=none + diff --git a/src/client/client.cpp b/src/client/client.cpp index 2b8e96e1..f98fe726 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -99,7 +99,6 @@ void Client::init() { layoutTimer->setInterval(0); layoutTimer->setSingleShot(false); connect(layoutTimer, SIGNAL(timeout()), this, SLOT(layoutMsg())); - } Client::~Client() { diff --git a/src/client/client.pro b/src/client/client.pro new file mode 100644 index 00000000..5e67dfb6 --- /dev/null +++ b/src/client/client.pro @@ -0,0 +1,2 @@ +SOURCES+=buffer.cpp buffertreemodel.cpp client.cpp clientsettings.cpp treemodel.cpp +HEADERS+=buffer.h buffertreemodel.h client.h clientsettings.h treemodel.h diff --git a/src/common/common.pro b/src/common/common.pro new file mode 100644 index 00000000..0561e307 --- /dev/null +++ b/src/common/common.pro @@ -0,0 +1,2 @@ +SOURCES+=global.cpp ircuser.cpp logger.cpp message.cpp settings.cpp signalproxy.cpp util.cpp +HEADERS+=global.h ircuser.h logger.h message.h quasselui.h settings.h signalproxy.h util.h diff --git a/src/common/ircuser.cpp b/src/common/ircuser.cpp index dd60aa90..be5f49ab 100644 --- a/src/common/ircuser.cpp +++ b/src/common/ircuser.cpp @@ -76,7 +76,8 @@ void IrcUser::setChannelmode(const QString &channel, const QSet &channe QSet IrcUser::channelmode(const QString &channel) const { if(channelmodes_.contains(channel)) - throw NoSuchChannelException(); + //throw NoSuchChannelException(); + Q_ASSERT(false); // FIXME: exception disabled for qtopia testing else return QSet(); } diff --git a/src/common/message.h b/src/common/message.h index 36950ec0..65d28280 100644 --- a/src/common/message.h +++ b/src/common/message.h @@ -34,15 +34,14 @@ struct Message { uint msgId; BufferId buffer; - QString target; QString text; QString sender; Type type; quint8 flags; QDateTime timeStamp; - Message(QString _target, Type _type = Plain, QString _text = "", QString _sender = "", quint8 _flags = None) - : target(_target), text(_text), sender(_sender), type(_type), flags(_flags) { timeStamp = QDateTime::currentDateTime().toUTC(); } + //Message(QString _target, Type _type = Plain, QString _text = "", QString _sender = "", quint8 _flags = None) + //: target(_target), text(_text), sender(_sender), type(_type), flags(_flags) { timeStamp = QDateTime::currentDateTime().toUTC(); } Message(BufferId _buffer = BufferId(), Type _type = Plain, QString _text = "", QString _sender = "", quint8 _flags = None) : buffer(_buffer), text(_text), sender(_sender), type(_type), flags(_flags) { timeStamp = QDateTime::currentDateTime().toUTC(); } diff --git a/src/contrib/qxt/qxt.pro b/src/contrib/qxt/qxt.pro new file mode 100644 index 00000000..5b2b89e6 --- /dev/null +++ b/src/contrib/qxt/qxt.pro @@ -0,0 +1,2 @@ +SOURCES+=qxtmetaobject.cpp qxtnull.cpp qxtrpcpeer.cpp +HEADERS+=qxtboundfunction.h qxtboundfunctionbase.h qxtglobal.h qxtmetaobject.h qxtnullable.h qxtnull.h qxtpimpl.h qxtrpcpeer.h diff --git a/src/contrib/qxt/qxtboundfunction.h b/src/contrib/qxt/qxtboundfunction.h index 80d02941..2c0e6444 100644 --- a/src/contrib/qxt/qxtboundfunction.h +++ b/src/contrib/qxt/qxtboundfunction.h @@ -45,7 +45,7 @@ public: return invoke(Qt::BlockingQueuedConnection, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); #else qWarning() << "QxtBoundFunction::invoke: Cannot return a value using a queued connection"; - return QxtNull; + return QxtNull(); #endif } diff --git a/src/core/core.cpp b/src/core/core.cpp index d6330385..dc22a973 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -94,6 +94,7 @@ void Core::stopListening() { void Core::incomingConnection() { // TODO implement SSL + // TODO While QTcpSocket *socket = server.nextPendingConnection(); connect(socket, SIGNAL(disconnected()), this, SLOT(clientDisconnected())); connect(socket, SIGNAL(readyRead()), this, SLOT(clientHasData())); diff --git a/src/qtgui/mainwin.cpp b/src/qtgui/mainwin.cpp index 61073a71..2bc5cf74 100644 --- a/src/qtgui/mainwin.cpp +++ b/src/qtgui/mainwin.cpp @@ -31,13 +31,13 @@ MainWin::MainWin(QtGui *_gui, QWidget *parent) : QMainWindow(parent), gui(_gui) { ui.setupUi(this); - //setWindowTitle("Quassel IRC"); - setWindowTitle(QString::fromUtf8("Κυασελ Εγαρζη")); + setWindowTitle("Quassel IRC"); + //setWindowTitle(QString::fromUtf8("Κυασελ Εγαρζη")); setWindowIcon(QIcon(":/qirc-icon.png")); setWindowIconText("Quassel IRC"); statusBar()->showMessage(tr("Waiting for core...")); - + } void MainWin::init() { diff --git a/src/qtopia/example.cpp b/src/qtopia/example.cpp new file mode 100644 index 00000000..b6756a34 --- /dev/null +++ b/src/qtopia/example.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2000-$THISYEAR$ $TROLLTECH$. All rights reserved. +** +** This file is part of the $MODULE$ of the Qtopia Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +****************************************************************************/ + +#include "example.h" +#include + +ExampleBase::ExampleBase( QWidget *parent, Qt::WFlags f ) + : QWidget( parent, f ) +{ + setupUi( this ); +} + +ExampleBase::~ExampleBase() +{ +} + +/* + * Constructs a Example which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + */ +Example::Example( QWidget *parent, Qt::WFlags f ) + : ExampleBase( parent, f ) +{ + connect(quit, SIGNAL(clicked()), this, SLOT(goodBye())); +} + +/* + * Destroys the object and frees any allocated resources + */ +Example::~Example() +{ + // no need to delete child widgets, Qt does it all for us +} + +/* + * A simple slot... not very interesting. + */ +void Example::goodBye() +{ + close(); +} + diff --git a/src/qtopia/example.desktop b/src/qtopia/example.desktop new file mode 100644 index 00000000..3a4067d0 --- /dev/null +++ b/src/qtopia/example.desktop @@ -0,0 +1,10 @@ +[Translation] +File=example-nct +Context=Example + +[Desktop Entry] +Comment[]=An Example Program +Exec=quasseltest +Icon=example/Example +Type=Application +Name[]=QuasselTest diff --git a/src/qtopia/example.h b/src/qtopia/example.h new file mode 100644 index 00000000..76d2bb06 --- /dev/null +++ b/src/qtopia/example.h @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2000-$THISYEAR$ $TROLLTECH$. All rights reserved. +** +** This file is part of the $MODULE$ of the Qtopia Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +****************************************************************************/ + +#ifndef EXAMPLE_H +#define EXAMPLE_H +#include "ui_examplebase.h" + +class ExampleBase : public QWidget, public Ui_ExampleBase +{ +public: + ExampleBase( QWidget *parent = 0, Qt::WFlags f = 0 ); + virtual ~ExampleBase(); +}; + +class Example : public ExampleBase +{ + Q_OBJECT +public: + Example( QWidget *parent = 0, Qt::WFlags f = 0 ); + virtual ~Example(); + +private slots: + void goodBye(); +}; + +#endif // EXAMPLE_H diff --git a/src/qtopia/examplebase.ui b/src/qtopia/examplebase.ui new file mode 100644 index 00000000..55a31877 --- /dev/null +++ b/src/qtopia/examplebase.ui @@ -0,0 +1,44 @@ + + + + + ExampleBase + + + + 0 + 0 + 196 + 245 + + + + Example + + + + 11 + + + 6 + + + + + This is just an example! It doesn't do anything interesting at all. + + + true + + + + + + + Quit + + + + + + diff --git a/src/qtopia/main.cpp b/src/qtopia/main.cpp new file mode 100644 index 00000000..0d113bfe --- /dev/null +++ b/src/qtopia/main.cpp @@ -0,0 +1,19 @@ +/**************************************************************************** +** +** Copyright (C) 2000-$THISYEAR$ $TROLLTECH$. All rights reserved. +** +** This file is part of the $MODULE$ of the Qtopia Toolkit. +** +** $TROLLTECH_DUAL_LICENSE$ +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +****************************************************************************/ + +#include "example.h" +#include + +QTOPIA_ADD_APPLICATION("example", Example) +QTOPIA_MAIN + diff --git a/src/qtopia/qtopia.pro b/src/qtopia/qtopia.pro new file mode 100644 index 00000000..4972eb71 --- /dev/null +++ b/src/qtopia/qtopia.pro @@ -0,0 +1,4 @@ +# Input +HEADERS += example.h +FORMS += examplebase.ui +SOURCES += example.cpp main.cpp -- 2.20.1