From 70b9eea2ba01c3691497f49e4c45cb070c16193c Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 1 Jul 2011 03:43:07 +0000 Subject: TQt4 port kradio This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kradio@1238952 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kradio3/plugins/radio/radio-configuration-ui.ui | 164 +++++++++---------- kradio3/plugins/radio/radio-configuration.cpp | 200 ++++++++++++------------ kradio3/plugins/radio/radio-configuration.h | 27 ++-- kradio3/plugins/radio/radio.cpp | 30 ++-- kradio3/plugins/radio/radio.h | 34 ++-- 5 files changed, 228 insertions(+), 227 deletions(-) (limited to 'kradio3/plugins/radio') diff --git a/kradio3/plugins/radio/radio-configuration-ui.ui b/kradio3/plugins/radio/radio-configuration-ui.ui index eee95e9..e56fc37 100644 --- a/kradio3/plugins/radio/radio-configuration-ui.ui +++ b/kradio3/plugins/radio/radio-configuration-ui.ui @@ -1,6 +1,6 @@ RadioConfigurationUI - + RadioConfigurationUI @@ -16,11 +16,11 @@ unnamed - + tabWidget3 - + stations @@ -34,9 +34,9 @@ 11 - + - layout32 + tqlayout32 6 @@ -45,7 +45,7 @@ unnamed - + labelStationList @@ -53,17 +53,17 @@ Stations - + - layout22 + tqlayout22 unnamed - + - layout9 + tqlayout9 @@ -82,15 +82,15 @@ - + - layout5 + tqlayout5 unnamed - + buttonNewStation @@ -101,7 +101,7 @@ "filenew2" - + buttonDeleteStation @@ -122,14 +122,14 @@ Expanding - + 20 10 - + buttonStationUp @@ -140,7 +140,7 @@ "1uparrow" - + buttonStationDown @@ -155,15 +155,15 @@ - + - layout21 + tqlayout21 unnamed - + buttonSearchStations @@ -179,10 +179,10 @@ &Search Stations - "find" + "tqfind" - + buttonLoadPresets @@ -201,7 +201,7 @@ "fileopen" - + buttonStorePresets @@ -226,19 +226,19 @@ - + - layout18 + tqlayout18 unnamed - + stackStationEdit - + page @@ -247,15 +247,15 @@ - + - layout7 + tqlayout7 unnamed - + labelStationName @@ -263,7 +263,7 @@ Name - + editStationName @@ -278,15 +278,15 @@ - + - layout32 + tqlayout32 unnamed - + labelStationShortName @@ -294,7 +294,7 @@ Short Name - + editStationShortName @@ -309,15 +309,15 @@ - + - layout6 + tqlayout6 unnamed - + labelPixmapFile @@ -325,15 +325,15 @@ Pixmap File - + - layout5 + tqlayout5 unnamed - + editPixmapFile @@ -346,7 +346,7 @@ - + buttonSelectPixmapFile @@ -358,7 +358,7 @@ 0 - + 0 0 @@ -375,15 +375,15 @@ - + - layout19 + tqlayout19 unnamed - + pixmapStation @@ -395,7 +395,7 @@ 0 - + 20 20 @@ -415,7 +415,7 @@ Expanding - + 10 5 @@ -434,22 +434,22 @@ Expanding - + 20 10 - + - layout20 + tqlayout20 unnamed - + editVolumePreset @@ -463,7 +463,7 @@ -1 - + labelVolumePreset @@ -481,7 +481,7 @@ Expanding - + 21 20 @@ -492,15 +492,15 @@ - + - layout25 + tqlayout25 unnamed - + editLabelPresetFile @@ -517,7 +517,7 @@ - + About @@ -541,22 +541,22 @@ Expanding - + 21 20 - + - layout21 + tqlayout21 unnamed - + labelCity @@ -564,12 +564,12 @@ City - + editCountry - + labelCountry @@ -577,15 +577,15 @@ Country - + - layout19 + tqlayout19 unnamed - + editLastChange @@ -601,7 +601,7 @@ StrongFocus - + buttonLastChangeNow @@ -619,7 +619,7 @@ - + labelComment @@ -627,12 +627,12 @@ Comment - + editComment - + labelMedia @@ -640,7 +640,7 @@ Media - + labelMaintainer @@ -648,12 +648,12 @@ Maintainer - + editCity - + labelLastChange @@ -661,12 +661,12 @@ Last Change - + editMaintainer - + editMedia @@ -683,21 +683,21 @@ Expanding - + 20 20 - + textLabel1 <p align="center">Click on the link below to contribute this station preset file to the kradio project.</p> - + WordBreak|AlignCenter @@ -705,7 +705,7 @@ mailLabel - + AlignCenter @@ -760,11 +760,11 @@ kiconloader.h - qwidgetstack.h + tqwidgetstack.h src/include/radiostation-listview.h SmallIconSet - + src/include/radiostation-listview.h kurlrequester.h diff --git a/kradio3/plugins/radio/radio-configuration.cpp b/kradio3/plugins/radio/radio-configuration.cpp index 321d17c..f28b933 100644 --- a/kradio3/plugins/radio/radio-configuration.cpp +++ b/kradio3/plugins/radio/radio-configuration.cpp @@ -28,82 +28,82 @@ #include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include +#include #include #include #include -RadioConfiguration::RadioConfiguration (QWidget *parent, const IErrorLogClient &logger) - : RadioConfigurationUI(parent), +RadioConfiguration::RadioConfiguration (TQWidget *tqparent, const IErrorLogClient &logger) + : RadioConfigurationUI(tqparent), ignoreChanges(false), devicePopup(NULL), m_logger(logger), m_dirty(true) { - QObject::connect(listStations, SIGNAL(sigCurrentStationChanged(int)), - this, SLOT(slotStationSelectionChanged(int))); - QObject::connect(buttonSelectPixmapFile, SIGNAL(clicked()), - this, SLOT(slotSelectPixmap())); - QObject::connect(buttonNewStation, SIGNAL(clicked()), - this, SLOT(slotNewStation())); - QObject::connect(buttonDeleteStation, SIGNAL(clicked()), - this, SLOT(slotDeleteStation())); - QObject::connect(editPixmapFile, SIGNAL(textChanged(const QString &)), - this, SLOT(slotPixmapChanged(const QString &))); - QObject::connect(editStationName, SIGNAL(textChanged(const QString &)), - this, SLOT(slotStationNameChanged(const QString &))); - QObject::connect(editStationShortName, SIGNAL(textChanged(const QString &)), - this, SLOT(slotStationShortNameChanged(const QString &))); - QObject::connect(editVolumePreset, SIGNAL(valueChanged(int)), - this, SLOT(slotVolumePresetChanged(int))); - QObject::connect(buttonStationUp, SIGNAL(clicked()), - this, SLOT(slotStationUp())); - QObject::connect(buttonStationDown, SIGNAL(clicked()), - this, SLOT(slotStationDown())); - QObject::connect(listStations, SIGNAL(sigStationActivated(int)), - this, SLOT(slotActivateStation( int ))); - QObject::connect(buttonLoadPresets, SIGNAL(clicked()), - this, SLOT(slotLoadPresets())); - QObject::connect(buttonStorePresets, SIGNAL(clicked()), - this, SLOT(slotStorePresets())); - QObject::connect(buttonLastChangeNow, SIGNAL(clicked()), - this, SLOT(slotLastChangeNow())); - - connect(editMaintainer, SIGNAL(textChanged(const QString &)), SLOT(slotSetDirty())); - connect(editLastChange, SIGNAL(valueChanged(const QDateTime &)), SLOT(slotSetDirty())); - connect(editCountry, SIGNAL(textChanged(const QString &)), SLOT(slotSetDirty())); - connect(editCity, SIGNAL(textChanged(const QString &)), SLOT(slotSetDirty())); - connect(editMedia, SIGNAL(textChanged(const QString &)), SLOT(slotSetDirty())); - connect(editComment, SIGNAL(textChanged(const QString &)), SLOT(slotSetDirty())); - connect(editPresetFile, SIGNAL(textChanged(const QString &)), SLOT(slotSetDirty())); + TQObject::connect(listStations, TQT_SIGNAL(sigCurrentStationChanged(int)), + this, TQT_SLOT(slotStationSelectionChanged(int))); + TQObject::connect(buttonSelectPixmapFile, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotSelectPixmap())); + TQObject::connect(buttonNewStation, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotNewStation())); + TQObject::connect(buttonDeleteStation, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotDeleteStation())); + TQObject::connect(editPixmapFile, TQT_SIGNAL(textChanged(const TQString &)), + this, TQT_SLOT(slotPixmapChanged(const TQString &))); + TQObject::connect(editStationName, TQT_SIGNAL(textChanged(const TQString &)), + this, TQT_SLOT(slotStationNameChanged(const TQString &))); + TQObject::connect(editStationShortName, TQT_SIGNAL(textChanged(const TQString &)), + this, TQT_SLOT(slotStationShortNameChanged(const TQString &))); + TQObject::connect(editVolumePreset, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotVolumePresetChanged(int))); + TQObject::connect(buttonStationUp, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotStationUp())); + TQObject::connect(buttonStationDown, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotStationDown())); + TQObject::connect(listStations, TQT_SIGNAL(sigStationActivated(int)), + this, TQT_SLOT(slotActivateStation( int ))); + TQObject::connect(buttonLoadPresets, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotLoadPresets())); + TQObject::connect(buttonStorePresets, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotStorePresets())); + TQObject::connect(buttonLastChangeNow, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotLastChangeNow())); + + connect(editMaintainer, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(slotSetDirty())); + connect(editLastChange, TQT_SIGNAL(valueChanged(const TQDateTime &)), TQT_SLOT(slotSetDirty())); + connect(editCountry, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(slotSetDirty())); + connect(editCity, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(slotSetDirty())); + connect(editMedia, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(slotSetDirty())); + connect(editComment, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(slotSetDirty())); + connect(editPresetFile, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(slotSetDirty())); mailLabel->setText("mailto:witte-presets@kawo1.rwth-aachen.de"); mailLabel->setURL ("mailto:witte-presets@kawo1.rwth-aachen.de"); - QObject::connect(mailLabel, SIGNAL(leftClickedURL(const QString &)), - this, SLOT(slotSendPresetsByMail(const QString &))); + TQObject::connect(mailLabel, TQT_SIGNAL(leftClickedURL(const TQString &)), + this, TQT_SLOT(slotSendPresetsByMail(const TQString &))); - QObject::connect(buttonSearchStations, SIGNAL(clicked()), - this, SLOT(slotSearchStations0())); + TQObject::connect(buttonSearchStations, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotSearchStations0())); - devicePopup = new QPopupMenu(buttonSearchStations); + devicePopup = new TQPopupMenu(buttonSearchStations); buttonSearchStations->setPopup(devicePopup); - QObject::connect(devicePopup, SIGNAL(activated(int)), - this, SLOT(slotSearchStations(int))); + TQObject::connect(devicePopup, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotSearchStations(int))); } @@ -130,9 +130,9 @@ bool RadioConfiguration::disconnectI (Interface *i) // IRadioDevicePoolClient -bool RadioConfiguration::noticeDevicesChanged(const QPtrList &l) +bool RadioConfiguration::noticeDevicesChanged(const TQPtrList &l) { - QPtrListIterator it(l); + TQPtrListIterator it(l); devices.clear(); devicePopup->clear(); int id = 0; @@ -147,7 +147,7 @@ bool RadioConfiguration::noticeDevicesChanged(const QPtrList &l) } -bool RadioConfiguration::noticeDeviceDescriptionChanged(const QString &) +bool RadioConfiguration::noticeDeviceDescriptionChanged(const TQString &) { noticeDevicesChanged(queryDevices()); return true; @@ -181,7 +181,7 @@ bool RadioConfiguration::noticeStationsChanged(const StationList &sl) } -bool RadioConfiguration::noticePresetFileChanged(const QString &f) +bool RadioConfiguration::noticePresetFileChanged(const TQString &f) { ignoreChanges = true; editPresetFile->setURL(f); @@ -215,12 +215,12 @@ void RadioConfiguration::slotStationSelectionChanged(int idx) if (ignoreChanges) return; ignoreChanges = true; - editStationName ->setText (s ? s->name() : QString::null); - editStationShortName ->setText (s ? s->shortName() : QString::null); - editPixmapFile ->setText (s ? s->iconName() : QString::null); + editStationName ->setText (s ? s->name() : TQString()); + editStationShortName ->setText (s ? s->shortName() : TQString()); + editPixmapFile ->setText (s ? s->iconName() : TQString()); editVolumePreset ->setValue (s ? (int)rint(s->initialVolume()*100) : -1); - QPixmap pixmap(s ? s->iconName() : QString::null); + TQPixmap pixmap(s ? s->iconName() : TQString()); if (!pixmap.isNull()) { pixmapStation->setPixmap(pixmap); } else { @@ -230,13 +230,13 @@ void RadioConfiguration::slotStationSelectionChanged(int idx) stackStationEdit->setDisabled(!s); if (s) { - RadioStationConfig *c = stationEditors.find(s->getClassName()); + RadioStationConfig *c = stationEditors.tqfind(s->getClassName()); if (!c) { c = s->createEditor(); if (c) { - c->reparent(this, QPoint(0,0), true); - QObject::connect(c, SIGNAL(changed(RadioStationConfig*)), - this, SLOT(slotStationEditorChanged(RadioStationConfig*))); + c->reparent(this, TQPoint(0,0), true); + TQObject::connect(c, TQT_SIGNAL(changed(RadioStationConfig*)), + this, TQT_SLOT(slotStationEditorChanged(RadioStationConfig*))); stationEditors.insert(s->getClassName(), c); stackStationEdit->addWidget(c); } @@ -306,7 +306,7 @@ void RadioConfiguration::slotStationEditorChanged(RadioStationConfig *c) } -void RadioConfiguration::slotStationNameChanged( const QString & s) +void RadioConfiguration::slotStationNameChanged( const TQString & s) { if (ignoreChanges) return; @@ -325,7 +325,7 @@ void RadioConfiguration::slotStationNameChanged( const QString & s) } -void RadioConfiguration::slotStationShortNameChanged( const QString & sn) +void RadioConfiguration::slotStationShortNameChanged( const TQString & sn) { if (ignoreChanges) return; @@ -346,7 +346,7 @@ void RadioConfiguration::slotStationShortNameChanged( const QString & sn) void RadioConfiguration::slotSelectPixmap() { - KURL url = KFileDialog::getImageOpenURL(QString::null, this, + KURL url = KFileDialog::getImageOpenURL(TQString(), this, i18n("Image Selection")); if (!url.isEmpty()) { if (url.isLocalFile()) { @@ -358,7 +358,7 @@ void RadioConfiguration::slotSelectPixmap() } -void RadioConfiguration::slotPixmapChanged( const QString &s ) +void RadioConfiguration::slotPixmapChanged( const TQString &s ) { if (ignoreChanges) return; @@ -368,7 +368,7 @@ void RadioConfiguration::slotPixmapChanged( const QString &s ) RadioStation &st = m_stations.at(idx); st.setIconName(s); ignoreChanges = true; - pixmapStation->setPixmap(QPixmap(s)); + pixmapStation->setPixmap(TQPixmap(s)); bool o = listStations->signalsBlocked(); listStations->blockSignals(true); listStations->setStation(idx, st); @@ -454,7 +454,7 @@ void RadioConfiguration::slotLoadPresets() fd.setMode(KFile::File | KFile::ExistingOnly); fd.setCaption (i18n("Select Preset File")); - if (fd.exec() == QDialog::Accepted) { + if (fd.exec() == TQDialog::Accepted) { slotSetDirty(); StationList sl; if (sl.readXML(fd.selectedURL(), m_logger)) { @@ -474,7 +474,7 @@ void RadioConfiguration::slotStorePresets() fd.setMode(KFile::File); fd.setCaption (i18n("Store Preset File")); - if (fd.exec() == QDialog::Accepted) { + if (fd.exec() == TQDialog::Accepted) { editPresetFile->setURL(fd.selectedURL().url()); m_stations.writeXML(fd.selectedURL(), m_logger); } @@ -484,46 +484,46 @@ void RadioConfiguration::slotStorePresets() void RadioConfiguration::slotLastChangeNow() { slotSetDirty(); - editLastChange->setDateTime(QDateTime::currentDateTime()); + editLastChange->setDateTime(TQDateTime::tqcurrentDateTime()); } -static QString &urlEscapes(QString &s) +static TQString &urlEscapes(TQString &s) { - s.replace(QRegExp("%"), "%25"); - s.replace(QRegExp("\t"), "%09"); - s.replace(QRegExp("\n"), "%0A"); - s.replace(QRegExp("\n"), "%0D"); - s.replace(QRegExp(" "), "%20"); - s.replace(QRegExp("\\!"), "%21"); - s.replace(QRegExp("\""), "%22"); - s.replace(QRegExp("#"), "%23"); - s.replace(QRegExp("\\$"), "%24"); - s.replace(QRegExp("\\&"), "%26"); - s.replace(QRegExp("'"), "%27"); - s.replace(QRegExp(","), "%2C"); - s.replace(QRegExp(":"), "%3A"); - s.replace(QRegExp(";"), "%3B"); - s.replace(QRegExp("="), "%3D"); - s.replace(QRegExp("\\?"), "%3F"); + s.tqreplace(TQRegExp("%"), "%25"); + s.tqreplace(TQRegExp("\t"), "%09"); + s.tqreplace(TQRegExp("\n"), "%0A"); + s.tqreplace(TQRegExp("\n"), "%0D"); + s.tqreplace(TQRegExp(" "), "%20"); + s.tqreplace(TQRegExp("\\!"), "%21"); + s.tqreplace(TQRegExp("\""), "%22"); + s.tqreplace(TQRegExp("#"), "%23"); + s.tqreplace(TQRegExp("\\$"), "%24"); + s.tqreplace(TQRegExp("\\&"), "%26"); + s.tqreplace(TQRegExp("'"), "%27"); + s.tqreplace(TQRegExp(","), "%2C"); + s.tqreplace(TQRegExp(":"), "%3A"); + s.tqreplace(TQRegExp(";"), "%3B"); + s.tqreplace(TQRegExp("="), "%3D"); + s.tqreplace(TQRegExp("\\?"), "%3F"); return s; } -void RadioConfiguration::slotSendPresetsByMail( const QString &url ) +void RadioConfiguration::slotSendPresetsByMail( const TQString &url ) { - QString presets = m_stations.writeXML(m_logger); + TQString presets = m_stations.writeXML(m_logger); urlEscapes(presets); // documentation says, krun object deletes itself, // so we do not need to store the pointer - QString country = m_stations.metaData().country; - QString city = m_stations.metaData().city; - QString location = city + "/" + country; + TQString country = m_stations.metaData().country; + TQString city = m_stations.metaData().city; + TQString location = city + "/" + country; urlEscapes(location); - QString cmd = url + "?subject=station preset file for " + location + "&body="; + TQString cmd = url + "?subject=station preset file for " + location + "&body="; cmd += presets; new KRun (cmd); @@ -541,7 +541,7 @@ void RadioConfiguration::slotSearchStations(int idev) sendActiveDevice(dev); x->show(); x->start(); - if (x->exec() == QDialog::Accepted) { + if (x->exec() == TQDialog::Accepted) { slotSetDirty(); m_stations.merge(x->getStations()); noticeStationsChanged(m_stations); diff --git a/kradio3/plugins/radio/radio-configuration.h b/kradio3/plugins/radio/radio-configuration.h index 31b29c8..b9c52b0 100644 --- a/kradio3/plugins/radio/radio-configuration.h +++ b/kradio3/plugins/radio/radio-configuration.h @@ -22,14 +22,14 @@ #include #endif -#include +#include #include "../../src/include/radio_interfaces.h" #include "../../src/include/stationlist.h" #include "../../src/include/radiodevicepool_interfaces.h" #include "radio-configuration-ui.h" -class QPopupMenu; +class TQPopupMenu; class RadioStationConfig; class RadioConfiguration : public RadioConfigurationUI, @@ -37,8 +37,9 @@ class RadioConfiguration : public RadioConfigurationUI, public IRadioDevicePoolClient { Q_OBJECT + TQ_OBJECT public : - RadioConfiguration (QWidget *parent, const IErrorLogClient &m_logger); + RadioConfiguration (TQWidget *tqparent, const IErrorLogClient &m_logger); ~RadioConfiguration (); bool connectI (Interface *i); @@ -48,8 +49,8 @@ public : RECEIVERS: bool noticeActiveDeviceChanged(IRadioDevice *) { return false; } - bool noticeDevicesChanged(const QPtrList &); - bool noticeDeviceDescriptionChanged(const QString &); + bool noticeDevicesChanged(const TQPtrList &); + bool noticeDeviceDescriptionChanged(const TQString &); // IRadioClient @@ -57,7 +58,7 @@ RECEIVERS: bool noticePowerChanged(bool /*on*/) { return false; } // don't care bool noticeStationChanged (const RadioStation &, int /*idx*/) { return false; } // don't care bool noticeStationsChanged(const StationList &sl); - bool noticePresetFileChanged(const QString &f); + bool noticePresetFileChanged(const TQString &f); bool noticeCurrentSoundStreamIDChanged(SoundStreamID /*id*/) { return false; } @@ -67,9 +68,9 @@ protected slots: void slotNewStation(); void slotDeleteStation(); void slotStationEditorChanged(RadioStationConfig *c); - void slotStationNameChanged( const QString & s); - void slotStationShortNameChanged( const QString & sn); - void slotPixmapChanged( const QString &s ); + void slotStationNameChanged( const TQString & s); + void slotStationShortNameChanged( const TQString & sn); + void slotPixmapChanged( const TQString &s ); void slotSelectPixmap(); void slotVolumePresetChanged(int v); void slotStationUp(); @@ -78,7 +79,7 @@ protected slots: void slotLoadPresets(); void slotStorePresets(); void slotLastChangeNow(); - void slotSendPresetsByMail( const QString &url ); + void slotSendPresetsByMail( const TQString &url ); void slotSearchStations(int i); void slotSearchStations0() { slotSearchStations(0); } @@ -93,10 +94,10 @@ protected: StationList m_stations; bool ignoreChanges; - QPopupMenu *devicePopup; - QPtrList devices; + TQPopupMenu *devicePopup; + TQPtrList devices; - QDict stationEditors; + TQDict stationEditors; const IErrorLogClient &m_logger; bool m_dirty; diff --git a/kradio3/plugins/radio/radio.cpp b/kradio3/plugins/radio/radio.cpp index 2320f56..af14e66 100644 --- a/kradio3/plugins/radio/radio.cpp +++ b/kradio3/plugins/radio/radio.cpp @@ -35,7 +35,7 @@ PLUGIN_LIBRARY_FUNCTIONS(Radio, "kradio-radio", i18n("Central Radio Device Multi ///////////////////////////////////////////////////////////////////////////// -Radio::Radio(const QString &name) +Radio::Radio(const TQString &name) : PluginBase(name, i18n("Radio Multiplexer Plugin")), IRadioDeviceClient(-1), m_presetFile(locateLocal("data", "kradio/stations.krp")), @@ -79,7 +79,7 @@ bool Radio::disconnectI (Interface *i) void Radio::saveState (KConfig *config) const { - config->setGroup(QString("radio-") + name()); + config->setGroup(TQString("radio-") + name()); config->writeEntry("presetfile", m_presetFile); @@ -89,10 +89,10 @@ void Radio::saveState (KConfig *config) const void Radio::restoreState (KConfig *config) { - config->setGroup(QString("radio-") + name()); + config->setGroup(TQString("radio-") + name()); m_presetFile = config->readEntry("presetfile", - QString::null); + TQString()); bool first_restore = false; if (m_presetFile.isNull() || m_presetFile.length() == 0) { m_presetFile = locateLocal("data", "kradio/stations.krp"); @@ -205,7 +205,7 @@ bool Radio::setStations(const StationList &sl) return true; } -bool Radio::setPresetFile(const QString &presetFile) +bool Radio::setPresetFile(const TQString &presetFile) { if (m_presetFile != presetFile) { m_presetFile = presetFile; @@ -217,7 +217,7 @@ bool Radio::setPresetFile(const QString &presetFile) int Radio::getStationIdx(const RadioStation &rs) const { RawStationList &sl = const_cast(m_stationList.all()); - return sl.find(&rs); + return sl.tqfind(&rs); } int Radio::getCurrentStationIdx() const @@ -245,7 +245,7 @@ bool Radio::setActiveDevice(IRadioDevice *rd, bool keepPower) // check if new station is in "connections" // special case: rd == NULL: power off active device, new active device = NULL - if (!rd || IRadioDeviceClient::iConnections.containsRef(rd)) { // new device is ok + if (!rd || IRadioDeviceClient::iConnections.tqcontainsRef(rd)) { // new device is ok // save old power state and power off old device bool oldPowerOn = false; @@ -280,13 +280,13 @@ IRadioDevice *Radio::getActiveDevice() const } -const QPtrList &Radio::getDevices() const +const TQPtrList &Radio::getDevices() const { return IRadioDeviceClient::iConnections; } -const QString &Radio::getDeviceDescription() const +const TQString &Radio::getDeviceDescription() const { return queryDescription(); } @@ -348,9 +348,9 @@ const RadioStation & Radio::queryCurrentStation() const } -static QString qstrUnknown(I18N_NOOP("unknown")); -static QString i18nqstrUnknown; -const QString &Radio::queryDescription() const +static TQString qstrUnknown(I18N_NOOP("unknown")); +static TQString i18nqstrUnknown; +const TQString &Radio::queryDescription() const { return m_activeDevice ? m_activeDevice->getDescription() : (i18nqstrUnknown = i18n(qstrUnknown.ascii())); } @@ -392,7 +392,7 @@ bool Radio::noticeStationChanged (const RadioStation &_rs, const IRadioDevice *s } -bool Radio::noticeDescriptionChanged (const QString &s, const IRadioDevice *sender) +bool Radio::noticeDescriptionChanged (const TQString &s, const IRadioDevice *sender) { if (sender == m_activeDevice) notifyDeviceDescriptionChanged(s); @@ -433,13 +433,13 @@ void Radio::noticeDisconnectI(IRadioDeviceClient::cmplInterface *rd, bool pointe if (rd == m_activeDevice) { // search a new active device - if (IRadioDeviceClient::iConnections.findRef(rd) >= 0) { + if (IRadioDeviceClient::iConnections.tqfindRef(rd) >= 0) { IRadioDevice *new_rd = NULL; new_rd = IRadioDeviceClient::iConnections.next(); // choose next device as active device if next exists if (!new_rd) { - IRadioDeviceClient::iConnections.findRef(rd); + IRadioDeviceClient::iConnections.tqfindRef(rd); new_rd = IRadioDeviceClient::iConnections.prev(); // otherwise try prev then, may be NULL (no connections) } setActiveDevice(new_rd); diff --git a/kradio3/plugins/radio/radio.h b/kradio3/plugins/radio/radio.h index 7913c16..d125eee 100644 --- a/kradio3/plugins/radio/radio.h +++ b/kradio3/plugins/radio/radio.h @@ -56,7 +56,7 @@ class Radio : public PluginBase, public ISoundStreamClient { public: - Radio(const QString &name); + Radio(const TQString &name); ~Radio(); @@ -66,10 +66,10 @@ public: virtual void saveState (KConfig *) const; virtual void restoreState (KConfig *); - virtual QString pluginClassName() const { return "Radio"; } + virtual TQString pluginClassName() const { return "Radio"; } - virtual const QString &name() const { return PluginBase::name(); } - virtual QString &name() { return PluginBase::name(); } + virtual const TQString &name() const { return PluginBase::name(); } + virtual TQString &name() { return PluginBase::name(); } virtual ConfigPageInfo createConfigurationPage(); virtual AboutPageInfo createAboutPage(); @@ -84,7 +84,7 @@ RECEIVERS: bool activateStation(const RadioStation &rs); bool activateStation(int index); bool setStations(const StationList &sl); - bool setPresetFile(const QString &presetFile); + bool setPresetFile(const TQString &presetFile); ANSWERS: bool isPowerOn() const { return queryIsPowerOn(); } @@ -93,7 +93,7 @@ ANSWERS: int getStationIdx(const RadioStation &) const; int getCurrentStationIdx() const; const StationList & getStations() const { return m_stationList; } - const QString & getPresetFile() const { return m_presetFile; } + const TQString & getPresetFile() const { return m_presetFile; } SoundStreamID getCurrentSoundStreamID() const; @@ -112,8 +112,8 @@ RECEIVERS: ANSWERS: IRadioDevice * getActiveDevice() const; - const QPtrList & getDevices() const; - const QString & getDeviceDescription() const; + const TQPtrList & getDevices() const; + const TQString & getDeviceDescription() const; @@ -125,17 +125,17 @@ SENDERS: IF_SENDER ( sendPowerOff() ) IF_SENDER ( sendActivateStation (const RadioStation &rs) ) -QUERIES: - IF_QUERY ( bool queryIsPowerOn() ) - IF_QUERY ( bool queryIsPowerOff() ) - IF_QUERY ( const RadioStation & queryCurrentStation() ) - IF_QUERY ( const QString & queryDescription() ) - IF_QUERY ( SoundStreamID queryCurrentSoundStreamID() ) +TQUERIES: + IF_TQUERY ( bool queryIsPowerOn() ) + IF_TQUERY ( bool queryIsPowerOff() ) + IF_TQUERY ( const RadioStation & queryCurrentStation() ) + IF_TQUERY ( const TQString & queryDescription() ) + IF_TQUERY ( SoundStreamID queryCurrentSoundStreamID() ) RECEIVERS: virtual bool noticePowerChanged (bool on, const IRadioDevice *sender = NULL); virtual bool noticeStationChanged (const RadioStation &rs, const IRadioDevice *sender = NULL); - virtual bool noticeDescriptionChanged (const QString &, const IRadioDevice *sender = NULL); + virtual bool noticeDescriptionChanged (const TQString &, const IRadioDevice *sender = NULL); virtual bool noticeCurrentSoundStreamIDChanged(SoundStreamID id, const IRadioDevice *sender = NULL); @@ -145,7 +145,7 @@ RECEIVERS: bool noticeAlarmsChanged(const AlarmVector &) { return false; } // ignore bool noticeAlarm(const Alarm &); bool noticeNextAlarmChanged(const Alarm *) { return false; } // ignore - bool noticeCountdownStarted(const QDateTime &/*end*/){ return false; } // ignore + bool noticeCountdownStarted(const TQDateTime &/*end*/){ return false; } // ignore bool noticeCountdownStopped() { return false; } // ignore bool noticeCountdownZero(); bool noticeCountdownSecondsChanged(int /*n*/) { return false; } // ignore @@ -158,7 +158,7 @@ RECEIVERS: protected: - QString m_presetFile; + TQString m_presetFile; StationList m_stationList; IRadioDevice *m_activeDevice; }; -- cgit v1.2.1