From: Yang Gu <gyagp0@gmail.com>
To: ofono@ofono.org
Subject: [PATCH v2 1/3] Move def of class ControlWidget to header file
Date: Fri, 01 Oct 2010 01:52:24 +0800 [thread overview]
Message-ID: <1285869146-30183-2-git-send-email-gyagp0@gmail.com> (raw)
In-Reply-To: <1285869146-30183-1-git-send-email-gyagp0@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 5381 bytes --]
Currently any modification on control.cpp will result in some unrelated
obj to be regenerated, because the definition of class ControlWidget is
in this .cpp file. This patch wants to fix this problem.
---
Makefile.am | 5 +---
src/control.cpp | 69 ------------------------------------------------------
src/control.h | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 70 insertions(+), 74 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 34198a5..f124b08 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -53,15 +53,12 @@ MAINTAINERCLEANFILES = Makefile.in \
aclocal.m4 configure depcomp missing install-sh
-$(src_phonesim_OBJECTS): src/control.moc src/ui_controlbase.h
+$(src_phonesim_OBJECTS): src/ui_controlbase.h
QT_V_MOC = $(QT_V_MOC_$(V))
QT_V_MOC_ = $(QT_V_MOC_$(AM_DEFAULT_VERBOSITY))
QT_V_MOC_0 = @echo " MOC " $@;
-src/control.moc: src/control.cpp
- $(QT_V_MOC)$(MOC) $(QT_CFLAGS) $(INCLUDES) $< -o $@
-
src/moc_%.cpp: src/%.h
$(QT_V_MOC)$(MOC) $< -o $@
diff --git a/src/control.cpp b/src/control.cpp
index 34a228f..458ee43 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -18,7 +18,6 @@
****************************************************************************/
#include "control.h"
-#include "ui_controlbase.h"
#include <qpushbutton.h>
#include <qslider.h>
#include <qcheckbox.h>
@@ -33,7 +32,6 @@
#include <QFile>
#include <QDir>
#include <QtGui/QHeaderView>
-#include "attranslator.h"
#define TWO_BYTE_MAX 65535
#define FOUR_CHAR 4
@@ -41,73 +39,6 @@
#define EIGHT_CHAR 8
#define HEX_BASE 16
-class ControlWidget : public QWidget
-{
-Q_OBJECT
-public:
- ControlWidget( const QString&, Control*);
-
- void handleFromData( const QString& );
- void handleToData( const QString& );
- void handleNewApp();
-
-private slots:
- void sendSQ();
- void sendBC();
- void chargingChanged(int state);
- void sendOPS();
- void sendREG();
- void sendCBM();
- void sendSMSMessage();
- void sendMGD();
- void selectFile();
- void sendSMSDatagram();
- void sendCall();
- void atChanged();
- void resetTranslator();
- void addVoicemail();
- void delVoicemail();
- void sendVMNotify( int type = 0 );
- void sendEVMNotify();
- void sendUSSD();
- void cancelUSSD();
- void simInsertRemove();
- void simAppStart();
- void simAppAbort();
-
-signals:
- void unsolicitedCommand(const QString &);
- void command(const QString &);
- void variableChanged(const QString &, const QString &);
- void switchTo(const QString &);
- void startIncomingCall(const QString &);
-
-protected:
- void closeEvent(QCloseEvent *event);
-
-private:
- Ui_ControlBase *ui;
- Control *p;
- AtTranslator *translator;
-
- class VoicemailItem {
- public:
- VoicemailItem( const QString &sender, bool urgent );
-
- QTableWidgetItem sender;
- QTableWidgetItem priority;
- QTableWidgetItem pending;
-
- bool notifyReceived;
- bool notifyDeleted;
- int id;
-
- static int nextId;
- };
- QList<VoicemailItem> mailbox;
-};
-#include "control.moc"
-
ControlWidget::ControlWidget(const QString &ruleFile, Control *parent)
: QWidget(), p(parent)
{
diff --git a/src/control.h b/src/control.h
index 32db57e..3577e8d 100644
--- a/src/control.h
+++ b/src/control.h
@@ -21,8 +21,76 @@
#define CONTROL_H
#include <hardwaremanipulator.h>
+#include "ui_controlbase.h"
+#include "attranslator.h"
-class ControlWidget;
+class Control;
+
+class ControlWidget : public QWidget
+{
+Q_OBJECT
+public:
+ ControlWidget( const QString&, Control*);
+
+ void handleFromData( const QString& );
+ void handleToData( const QString& );
+ void handleNewApp();
+
+private slots:
+ void sendSQ();
+ void sendBC();
+ void chargingChanged(int state);
+ void sendOPS();
+ void sendREG();
+ void sendCBM();
+ void sendSMSMessage();
+ void sendMGD();
+ void selectFile();
+ void sendSMSDatagram();
+ void sendCall();
+ void atChanged();
+ void resetTranslator();
+ void addVoicemail();
+ void delVoicemail();
+ void sendVMNotify( int type = 0 );
+ void sendEVMNotify();
+ void sendUSSD();
+ void cancelUSSD();
+ void simInsertRemove();
+ void simAppStart();
+ void simAppAbort();
+
+signals:
+ void unsolicitedCommand(const QString &);
+ void command(const QString &);
+ void variableChanged(const QString &, const QString &);
+ void switchTo(const QString &);
+ void startIncomingCall(const QString &);
+
+protected:
+ void closeEvent(QCloseEvent *event);
+
+private:
+ Ui_ControlBase *ui;
+ Control *p;
+ AtTranslator *translator;
+
+ class VoicemailItem {
+ public:
+ VoicemailItem( const QString &sender, bool urgent );
+
+ QTableWidgetItem sender;
+ QTableWidgetItem priority;
+ QTableWidgetItem pending;
+
+ bool notifyReceived;
+ bool notifyDeleted;
+ int id;
+
+ static int nextId;
+ };
+ QList<VoicemailItem> mailbox;
+};
class Control: public HardwareManipulator
{
--
1.7.0.4
next prev parent reply other threads:[~2010-09-30 17:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-30 17:52 [PATCH v2 0/3] Patch Description Yang Gu
2010-09-30 17:52 ` Yang Gu [this message]
2010-09-30 17:52 ` [PATCH v2 2/3] Some instances in ControlWidget need to be deleted Yang Gu
2010-09-30 17:52 ` [PATCH v2 3/3] Enable Qt Script Yang Gu
2010-10-13 20:19 ` [PATCH v2 0/3] Patch Description Denis Kenzior
2010-10-14 11:17 ` Gu, Yang
2010-10-14 11:23 ` Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1285869146-30183-2-git-send-email-gyagp0@gmail.com \
--to=gyagp0@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox