SVN commit 890997 by mzanetti: warnings-- M +17 -17 irkick/irkick.cpp M +1 -2 irkick/irkick.h M +0 -3 irkick/klircclient.cpp M +10 -6 kcmlirc/addaction.cpp M +11 -12 kcmlirc/editaction.cpp M +1 -1 kcmlirc/editmode.cpp M +1 -1 kcmlirc/editmode.h M +6 -6 kcmlirc/kcmlirc.cpp M +1 -1 kcmlirc/modeslist.cpp M +1 -1 kcmlirc/modeslist.h M +6 -6 kdelirc/iraction.h M +1 -2 kdelirc/modes.cpp M +3 -3 kdelirc/profileserver.h M +3 -4 kdelirc/prototype.h --- trunk/playground/utils/kdelirc/irkick/irkick.cpp #890996:890997 @@ -41,14 +41,10 @@ #include "irkickadaptor.h" #include -void IRKTrayIcon::mousePressEvent(QMouseEvent *e) -{ -// KSystemTrayIcon::mousePressEvent(new QMouseEvent(QEvent::MouseButtonPress, e->pos(), e->globalPos(), e->button() == Qt::LeftButton ? Qt::RightButton : e->button(), e->state())); -} - IRKick::IRKick(const QString &obj) : QObject(), npApp(QString::null) //krazy:exclude=nullstrassign for old broken gcc { + Q_UNUSED(obj) new IrkickAdaptor(this); QDBusConnection dBusConnection = QDBusConnection::sessionBus(); dBusConnection.registerObject("/IRKick", this, QDBusConnection::ExportAllSlots); @@ -76,8 +72,9 @@ //FIXME: Bring back the Tray Icons Menu theTrayIcon->contextMenu()->setTitle( "IRKick"); theTrayIcon->contextMenu()->addAction(SmallIcon( "configure" ), i18n("&Configure..."), this, SLOT(slotConfigure())); +// QAction *helpAction = new QAction(SmallIcon( "help-contents" ), i18n("&Help"), ); +// theTrayIcon->contextMenu()->addAction(helpAction); // theTrayIcon->contextMenu()->insertSeparator(); -// theTrayIcon->contextMenu()->insertItem(SmallIcon( "help-contents" ), i18n("&Help"), (new KHelpMenu(theTrayIcon, KGlobal::mainComponent().aboutData()))->menu()); theTrayIcon->actionCollection()->action("file_quit")->disconnect(SIGNAL(activated())); connect(theTrayIcon->actionCollection()->action("file_quit"), SIGNAL(activated()), SLOT(doQuit())); @@ -100,13 +97,14 @@ void IRKick::checkLirc() { - if(!theClient->isConnected()) - if(theClient->connectToLirc()) - { KPassivePopup::message("IRKick", i18n("A connection to the infrared system has been made. Remote controls may now be available."), SmallIcon("irkick"), theTrayIcon); + if(!theClient->isConnected()) { + if(theClient->connectToLirc()) { + KPassivePopup::message("IRKick", i18n("A connection to the infrared system has been made. Remote controls may now be available."), SmallIcon("irkick"), theTrayIcon); theTrayIcon->setIcon(theTrayIcon->loadIcon("irkick")); + } else { + QTimer::singleShot(10000, this, SLOT(checkLirc())); } - else - QTimer::singleShot(10000, this, SLOT(checkLirc())); + } } void IRKick::flashOff() @@ -348,16 +346,18 @@ break; } - for(int after = 0; after < 2; after++) - { if(doBefore && !after || doAfter && after) - for(int i = 0; i < l.size(); ++i) + for(int after = 0; after < 2; after++) { + if((doBefore && !after) || (doAfter && after)) + for(int i = 0; i < l.size(); ++i) { if(!l.at(i)->isModeChange() && (l.at(i)->repeat() || !theRepeatCounter)) { executeAction(*l.at(i)); } - if(!after && doAfter) - { l = allActions.findByModeButton(Mode(theRemote, currentModes[theRemote]), theButton); - if(!currentModes[theRemote].isEmpty()) + } + if(!after && doAfter){ + l = allActions.findByModeButton(Mode(theRemote, currentModes[theRemote]), theButton); + if(!currentModes[theRemote].isEmpty()) { l += allActions.findByModeButton(Mode(theRemote, ""), theButton); + } } } } --- trunk/playground/utils/kdelirc/irkick/irkick.h #890996:890997 @@ -26,13 +26,12 @@ class IRKTrayIcon: public KSystemTrayIcon { - void mousePressEvent(QMouseEvent *e); public: QMenu* contextMenu() const { return KSystemTrayIcon::contextMenu(); } KActionCollection* actionCollection() { return KSystemTrayIcon::actionCollection(); } - IRKTrayIcon(QWidget *parent = 0, const char *name = 0): KSystemTrayIcon(parent) {} +IRKTrayIcon(QWidget *parent = 0, const char *name = 0): KSystemTrayIcon(parent) {Q_UNUSED(name)} }; class IRKick: public QObject --- trunk/playground/utils/kdelirc/irkick/klircclient.cpp #890996:890997 @@ -218,9 +218,6 @@ const QString KLircClient::readLine() { if (!theSocket->canReadLine()) { - bool timeout; - // FIXME: possible race condition - - // more might have arrived between canReadLine and waitForMore theSocket->waitForReadyRead(500); if (!theSocket->canReadLine()){ // Still nothing :( return QString(); --- trunk/playground/utils/kdelirc/kcmlirc/addaction.cpp #890996:890997 @@ -33,6 +33,8 @@ AddAction::AddAction(QWidget *parent, const char *name, const Mode &mode): theMode(mode) { + Q_UNUSED(name) + Q_UNUSED(parent) setupUi(this); @@ -117,12 +119,13 @@ } - if(curPage == 2 && theUseProfile->isChecked()) + if(curPage == 2 && theUseProfile->isChecked()) { if(lastPage > 1) { back(); } else { next(); } + } if(curPage == 2 && theChangeMode->isChecked() && lastPage == 1){ next(); next(); @@ -137,11 +140,13 @@ back(); } - if(curPage == 3 && theUseDCOP->isChecked()) - if(lastPage == 4) + if(curPage == 3 && theUseDCOP->isChecked()){ + if(lastPage == 4) { back(); - else + } else { next(); + } + } if(curPage == 3){ updateProfileFunctions(); @@ -245,7 +250,6 @@ void AddAction::updateButtonStates() { -#warning Port me! kDebug() << "Updating button states"; switch(currentId()){ case 0: @@ -436,7 +440,7 @@ if(theUseDCOP->isChecked() && theFunctions->currentItem()) { Prototype p(theFunctions->currentItem()->text(2)); - for(unsigned k = 0; k < p.count(); k++) { + for(int k = 0; k < p.count(); k++) { QStringList parameters; parameters << (p.name(k).isEmpty() ? i18n( "" ) : p.name(k)) << "" << p.type(k) << QString().setNum(k + 1); new QTreeWidgetItem(theParameters, parameters); --- trunk/playground/utils/kdelirc/kcmlirc/editaction.cpp #890996:890997 @@ -37,8 +37,10 @@ #include "editaction.h" #include "addaction.h" -EditAction::EditAction(IRAction *action, QWidget *parent, const char *name) //: EditActionBase(parent, name) +EditAction::EditAction(IRAction *action, QWidget *parent, const char *name) { + Q_UNUSED(name) + Q_UNUSED(parent) theAction = action; //KWindowSystem::setState(widget->winId(), NET::StaysOnTop ); @@ -123,13 +125,10 @@ (*theAction).setDoBefore(theDoBefore->isChecked()); (*theAction).setDoAfter(theDoAfter->isChecked()); } - else if(theUseProfile->isChecked() && ( - ProfileServer::profileServer()->getAction(applicationMap[theApplications->currentText()], functionMap[theFunctions->currentText()]) - || - theJustStart->isChecked() && ProfileServer::profileServer()->profiles()[theApplications->currentText()] - ) - ) - { if(theJustStart->isChecked()) + else if(theUseProfile->isChecked() && + ((ProfileServer::profileServer()->getAction(applicationMap[theApplications->currentText()], functionMap[theFunctions->currentText()]) || theJustStart->isChecked()) && + ProfileServer::profileServer()->profiles()[theApplications->currentText()])) { + if(theJustStart->isChecked()) { (*theAction).setProgram(ProfileServer::profileServer()->profiles()[applicationMap[theApplications->currentText()]]->id()); (*theAction).setObject(""); } @@ -165,11 +164,11 @@ const QList &p = a->arguments(); if(p.count() != arguments.count()) { arguments.clear(); - for(unsigned i = 0; i < p.count(); i++) + for(int i = 0; i < p.count(); i++) arguments.append(QVariant("")); } theArguments->setEnabled(p.count()); - for(unsigned i = 0; i < p.count(); i++) + for(int i = 0; i < p.count(); i++) { theArguments->addItem(p[i].comment() + " (" + p[i].type() + ")"); arguments[i].convert(QVariant::nameToType(p[i].type().toLocal8Bit())); } @@ -181,11 +180,11 @@ Prototype p(theDCOPFunctions->currentText()); if(p.count() != arguments.count()) { arguments.clear(); - for(unsigned i = 0; i < p.count(); i++) + for(int i = 0; i < p.count(); i++) arguments.append(QVariant("")); } theArguments->setEnabled(p.count()); - for(unsigned i = 0; i < p.count(); i++) + for(int i = 0; i < p.count(); i++) { theArguments->addItem(QString().setNum(i + 1) + ": " + (p.name(i).isEmpty() ? p.type(i) : p.name(i) + " (" + p.type(i) + ")")); arguments[i].convert(QVariant::nameToType(p.type(i).toLocal8Bit())); } --- trunk/playground/utils/kdelirc/kcmlirc/editmode.cpp #890996:890997 @@ -16,7 +16,7 @@ #include "editmode.h" -EditMode::EditMode(QWidget *parent, const char *name, bool modal, Qt::WFlags fl)// : Ui::EditModeBase(parent, name, modal, fl) +EditMode::EditMode(QWidget *parent, Qt::WFlags fl) : QDialog(parent, fl) { setupUi(this); theIcon->setIconType(KIconLoader::Panel, KIconLoader::Any); --- trunk/playground/utils/kdelirc/kcmlirc/editmode.h #890996:890997 @@ -26,7 +26,7 @@ void slotCheckText(const QString &newText); void slotClearIcon(); - EditMode(QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags fl = 0); + EditMode(QWidget *parent = 0, Qt::WFlags fl = 0); ~EditMode(); }; --- trunk/playground/utils/kdelirc/kcmlirc/kcmlirc.cpp #890996:890997 @@ -64,7 +64,6 @@ setAboutData(new KAboutData("kcmlirc", 0, ki18n("KDE Lirc"), VERSION, ki18n("The KDE IR Remote Control System"), KAboutData::License_GPL_V2, ki18n("Copyright (c)2003 Gav Wood"), ki18n("Use this to configure KDE's infrared remote control system in order to control any KDE application with your infrared remote control."), "http://www.kde.org")); setButtons(KCModule::Help); setQuickHelp(i18n("

Remote Controls

This module allows you to configure bindings between your remote controls and KDE applications. Simply select your remote control and click Add under the Actions/Buttons list. If you want KDE to attempt to automatically assign buttons to a supported application's actions, try clicking the Auto-Populate button.

To view the recognised applications and remote controls, simply select the Loaded Extensions tab.

")); - bool ok; QDBusMessage m = QDBusMessage::createMethodCall("org.kde.irkick", "/IRKick", "", "remotes"); QDBusMessage response = QDBusConnection::sessionBus().call(m); @@ -406,7 +405,12 @@ void KCMLirc::updateActions() { - IRAction *oldCurrent; + + if(theKCMLircBase->theModes->selectedItems().isEmpty()) { + return; + } + + IRAction *oldCurrent = 0; if(!theKCMLircBase->theActions->selectedItems().isEmpty()){ oldCurrent = actionMap[theKCMLircBase->theActions->selectedItems().first()]; } @@ -414,10 +418,6 @@ theKCMLircBase->theActions->clear(); actionMap.clear(); - if(theKCMLircBase->theModes->selectedItems().isEmpty()) { - return; - } - Mode m = modeMap[theKCMLircBase->theModes->selectedItems().first()]; theKCMLircBase->theModeLabel->setText(m.remoteName() + ": " + (m.name().isEmpty() ? i18n("Actions always available") : i18n("Actions available only in mode %1", m.name()))); IRActions l = allActions.findByMode(m); --- trunk/playground/utils/kdelirc/kcmlirc/modeslist.cpp #890996:890997 @@ -18,7 +18,7 @@ #include "modeslist.h" -ModesList::ModesList(QWidget *parent, const char *name) : QTreeWidget(parent) +ModesList::ModesList(QWidget *parent) : QTreeWidget(parent) { setAcceptDrops(true); setDropIndicatorShown(true); --- trunk/playground/utils/kdelirc/kcmlirc/modeslist.h #890996:890997 @@ -28,7 +28,7 @@ Q_OBJECT public: virtual bool acceptDrag(QDropEvent *) const; - ModesList(QWidget *parent = 0, const char *name = 0); + ModesList(QWidget *parent = 0); }; #endif --- trunk/playground/utils/kdelirc/kdelirc/iraction.h #890996:890997 @@ -56,14 +56,14 @@ const QString &mode() const { return theMode; } const QString &button() const { return theButton; } const Arguments arguments() const { if(theProgram != "" && theObject != "") return theArguments; return Arguments(); } - const bool repeat() const { return theRepeat; } - const bool autoStart() const { return theAutoStart; } - const IfMulti ifMulti() const { return theIfMulti; } - const bool unique() const { return theUnique; } + bool repeat() const { return theRepeat; } + bool autoStart() const { return theAutoStart; } + IfMulti ifMulti() const { return theIfMulti; } + bool unique() const { return theUnique; } const QString &modeChange() const { return theObject; } - const bool doBefore() const { return theDoBefore; } - const bool doAfter() const { return theDoAfter; } + bool doBefore() const { return theDoBefore; } + bool doAfter() const { return theDoAfter; } bool isModeChange() const { return theProgram == ""; } bool isJustStart() const { return theProgram != "" && theObject == ""; } --- trunk/playground/utils/kdelirc/kdelirc/modes.cpp #890996:890997 @@ -115,8 +115,7 @@ void Modes::erase(const Mode &mode) { -#warning DELETE Mode -// operator[](mode.remote()).erase(mode.name()); + operator[](mode.remote()).remove(mode.name()); kDebug() << "should erease mode..."; } --- trunk/playground/utils/kdelirc/kdelirc/profileserver.h #890996:890997 @@ -72,7 +72,7 @@ void setComment(const QString &a) { theComment = a; } const QString &getClass() const { return theClass; } void setClass(const QString &a) { theClass = a; } - const float multiplier() const { return theMultiplier; } + float multiplier() const { return theMultiplier; } void setMultiplier(const float a) { theMultiplier = a; } bool repeat() const { return theRepeat; } void setRepeat(bool a) { theRepeat = a; } @@ -107,9 +107,9 @@ void setName(const QString &a) { theName = a; } const QString &author() const { return theAuthor; } void setAuthor(const QString &a) { theAuthor = a; } - const bool unique() const { return theUnique; } + bool unique() const { return theUnique; } void setUnique(const bool a) { theUnique = a; } - const IfMulti ifMulti() const { return theIfMulti; } + IfMulti ifMulti() const { return theIfMulti; } void setIfMulti(const IfMulti a) { theIfMulti = a; } const QString &serviceName() const { if(theServiceName != QString()) return theServiceName; return theName; } void setServiceName(const QString &a) { theServiceName = a; } --- trunk/playground/utils/kdelirc/kdelirc/prototype.h #890996:890997 @@ -29,7 +29,7 @@ void parse(); public: - unsigned count() const{ return theTypes.count(); } + int count() const{ return theTypes.count(); } const QPair operator[](int i) const { return qMakePair(theTypes[i], theNames[i]); } const QString &name(int i) const { return theNames[i]; } const QString &type(int i) const { return theTypes[i]; } @@ -38,9 +38,8 @@ const QString &prototype() const { return original; } const QString argumentList() const; const QString argumentListNN() const; - const int argumentCount() { return theTypes.count(); } -// const QString prototypeNR() const { return theName + "(" + argumentListNN() + ")"; } - const QString prototypeNR() const { return theName; } + int argumentCount() { return theTypes.count(); } + const QString prototypeNR() const { return theName + "(" + argumentListNN() + ")"; } void setPrototype(const QString &source) { original = source; parse(); }