summaryrefslogtreecommitdiffstats
path: root/kweather
diff options
context:
space:
mode:
Diffstat (limited to 'kweather')
-rw-r--r--kweather/dockwidget.cpp110
-rw-r--r--kweather/dockwidget.h24
-rw-r--r--kweather/kcmweather.cpp48
-rw-r--r--kweather/kcmweather.h6
-rw-r--r--kweather/kcmweatherservice.cpp10
-rw-r--r--kweather/kcmweatherservice.h2
-rw-r--r--kweather/kweather.cpp74
-rw-r--r--kweather/kweather.h20
-rw-r--r--kweather/metar_parser.cpp124
-rw-r--r--kweather/metar_parser.h94
-rw-r--r--kweather/metar_parser_test.cpp30
-rw-r--r--kweather/reportmain.cpp6
-rw-r--r--kweather/reportview.cpp98
-rw-r--r--kweather/reportview.h6
-rw-r--r--kweather/serviceconfigwidget.cpp68
-rw-r--r--kweather/serviceconfigwidget.h6
-rw-r--r--kweather/sidebarwidget.cpp12
-rw-r--r--kweather/sidebarwidget.h10
-rw-r--r--kweather/stationdatabase.cpp54
-rw-r--r--kweather/stationdatabase.h22
-rw-r--r--kweather/stationdatabase_test.cpp14
-rw-r--r--kweather/sun.cpp30
-rw-r--r--kweather/sun.h22
-rw-r--r--kweather/sun_test.cpp18
-rw-r--r--kweather/weatherIface.h2
-rw-r--r--kweather/weatherbar.cpp56
-rw-r--r--kweather/weatherbar.h22
-rw-r--r--kweather/weatherbutton.cpp46
-rw-r--r--kweather/weatherbutton.h28
-rw-r--r--kweather/weatherlib.cpp82
-rw-r--r--kweather/weatherlib.h58
-rw-r--r--kweather/weatherservice.cpp118
-rw-r--r--kweather/weatherservice.h92
33 files changed, 706 insertions, 706 deletions
diff --git a/kweather/dockwidget.cpp b/kweather/dockwidget.cpp
index 6d9dd92..b100ec9 100644
--- a/kweather/dockwidget.cpp
+++ b/kweather/dockwidget.cpp
@@ -20,23 +20,23 @@
#include "weatherbutton.h"
#include "weatherservice_stub.h"
-#include <qtooltip.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qtimer.h>
-#include <qobjectlist.h>
+#include <tqtooltip.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqtimer.h>
+#include <tqobjectlist.h>
#include <kdebug.h>
#include <kglobalsettings.h>
#include <klocale.h>
-dockwidget::dockwidget(const QString &location, QWidget *parent,
- const char *name) : QWidget(parent,name), m_locationCode( location ), m_orientation( Horizontal )
+dockwidget::dockwidget(const TQString &location, TQWidget *parent,
+ const char *name) : TQWidget(parent,name), m_locationCode( location ), m_orientation( Horizontal )
{
m_font = KGlobalSettings::generalFont();
setBackgroundOrigin( AncestorOrigin );
initDock();
- connect(m_button, SIGNAL( clicked() ), SIGNAL( buttonClicked() ));
+ connect(m_button, TQT_SIGNAL( clicked() ), TQT_SIGNAL( buttonClicked() ));
m_weatherService = new WeatherService_stub( "KWeatherService", "WeatherService" );
}
@@ -46,7 +46,7 @@ dockwidget::~dockwidget()
delete m_weatherService;
}
-void dockwidget::setLocationCode(const QString &locationCode)
+void dockwidget::setLocationCode(const TQString &locationCode)
{
m_locationCode = locationCode;
showWeather();
@@ -78,11 +78,11 @@ void dockwidget::setViewMode(int _mode)
void dockwidget::showWeather()
{
- QString tip = "<qt>";
+ TQString tip = "<qt>";
- QString temp = "?";
- QString wind = "?";
- QString pressure = "?";
+ TQString temp = "?";
+ TQString wind = "?";
+ TQString pressure = "?";
if ( !m_locationCode.isEmpty() )
{
@@ -90,12 +90,12 @@ void dockwidget::showWeather()
wind = m_weatherService->wind( m_locationCode );
pressure = m_weatherService->pressure( m_locationCode );
- QString dewPoint = m_weatherService->dewPoint( m_locationCode);
- QString relHumidity = m_weatherService->relativeHumidity( m_locationCode );
- QString heatIndex = m_weatherService->heatIndex( m_locationCode );
- QString windChill = m_weatherService->windChill( m_locationCode );
- QString sunRiseTime = m_weatherService->sunRiseTime( m_locationCode );
- QString sunSetTime = m_weatherService->sunSetTime( m_locationCode );
+ TQString dewPoint = m_weatherService->dewPoint( m_locationCode);
+ TQString relHumidity = m_weatherService->relativeHumidity( m_locationCode );
+ TQString heatIndex = m_weatherService->heatIndex( m_locationCode );
+ TQString windChill = m_weatherService->windChill( m_locationCode );
+ TQString sunRiseTime = m_weatherService->sunRiseTime( m_locationCode );
+ TQString sunSetTime = m_weatherService->sunSetTime( m_locationCode );
tip += "<h3><center><nobr>" +
m_weatherService->stationName( m_locationCode ) + " (" +
@@ -104,7 +104,7 @@ void dockwidget::showWeather()
if ( m_weatherService->currentIconString( m_locationCode ) == "dunno" ) // no data
tip += "<center><nobr>" + i18n("The network is currently offline...") + "</nobr></center>";
- tip += QString("<br><table>"
+ tip += TQString("<br><table>"
"<tr><th><nobr>" + i18n( "Temperature:" ) + "</nobr></th><td><nobr>%1</nobr></td>"
"<th><nobr>" + i18n( "Dew Point:" ) + "</nobr></th><td><nobr>%2</nobr></td></nobr></tr>"
@@ -115,14 +115,14 @@ void dockwidget::showWeather()
.arg(temp).arg(dewPoint).arg(pressure).arg(relHumidity).arg(wind);
if ( !heatIndex.isEmpty() )
- tip += QString("<th><nobr>" + i18n( "Heat Index:" ) + "</nobr></th><td><nobr>%1</nobr></td>").arg(heatIndex);
+ tip += TQString("<th><nobr>" + i18n( "Heat Index:" ) + "</nobr></th><td><nobr>%1</nobr></td>").arg(heatIndex);
else if ( !windChill.isEmpty() )
- tip += QString("<th><nobr>" + i18n( "Wind Chill:" ) + "</nobr></th><td><nobr>%1</nobr></td>").arg(windChill);
+ tip += TQString("<th><nobr>" + i18n( "Wind Chill:" ) + "</nobr></th><td><nobr>%1</nobr></td>").arg(windChill);
else
tip += "<td>&nbsp;</td><td>&nbsp;</td>";
tip += "</tr>";
- tip += QString("<tr><th><nobr>" + i18n( "Sunrise:" ) + "</nobr></th><td><nobr>%1</nobr></td>" +
+ tip += TQString("<tr><th><nobr>" + i18n( "Sunrise:" ) + "</nobr></th><td><nobr>%1</nobr></td>" +
"<th><nobr>" + i18n( "Sunset:" ) + "</nobr></th><td><nobr>%2</nobr></td>")
.arg(sunRiseTime).arg(sunSetTime);
@@ -144,10 +144,10 @@ void dockwidget::showWeather()
tip += "</qt>";
// On null or empty location code, or if the station needs maintenance, this will return the dunno icon.
- QPixmap icon = m_weatherService->icon( m_locationCode );
+ TQPixmap icon = m_weatherService->icon( m_locationCode );
- QToolTip::remove(this);
- QToolTip::add(this, tip);
+ TQToolTip::remove(this);
+ TQToolTip::add(this, tip);
kdDebug(12004) << "show weather: " << endl;
kdDebug(12004) << "location: " << m_locationCode << endl;
@@ -167,9 +167,9 @@ void dockwidget::initDock()
m_button= new WeatherButton(this,"m_button");
- m_lblTemp= new QLabel(this,"lblTemp");
- m_lblWind= new QLabel(this,"lblWind");
- m_lblPres= new QLabel(this,"lblPres");
+ m_lblTemp= new TQLabel(this,"lblTemp");
+ m_lblWind= new TQLabel(this,"lblWind");
+ m_lblPres= new TQLabel(this,"lblPres");
m_lblTemp->setBackgroundOrigin(AncestorOrigin);
m_lblWind->setBackgroundOrigin(AncestorOrigin);
@@ -179,12 +179,12 @@ void dockwidget::initDock()
m_lblWind->setMargin(0);
m_lblPres->setMargin(0);
- QBoxLayout *mainLayout = new QBoxLayout(this, QBoxLayout::TopToBottom);
+ TQBoxLayout *mainLayout = new TQBoxLayout(this, TQBoxLayout::TopToBottom);
mainLayout->setSpacing(0);
mainLayout->setMargin(0);
mainLayout->addWidget(m_button, 0, Qt::AlignCenter);
- QBoxLayout *layout = new QBoxLayout(mainLayout, QBoxLayout::TopToBottom);
+ TQBoxLayout *layout = new TQBoxLayout(mainLayout, TQBoxLayout::TopToBottom);
layout->setSpacing(0);
layout->setMargin(0);
layout->addWidget(m_lblTemp);
@@ -195,11 +195,11 @@ void dockwidget::initDock()
updateFont();
- QTimer::singleShot( 0, this, SLOT( showWeather() ) );
+ TQTimer::singleShot( 0, this, TQT_SLOT( showWeather() ) );
}
/** resize the view **/
-void dockwidget::resizeView( const QSize &size )
+void dockwidget::resizeView( const TQSize &size )
{
kdDebug(12004) << "Changing to size " << size << endl;
resize(size);
@@ -212,15 +212,15 @@ void dockwidget::resizeView( const QSize &size )
{
if ( h <= 128 ) // left to right layout
{
- static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::LeftToRight);
+ static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
m_lblWind->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
m_lblPres->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
}
else // top to bottom
{
- static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::TopToBottom);
- QFontMetrics fm(m_font);
+ static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom);
+ TQFontMetrics fm(m_font);
h = 128 - (3 * fm.height()); // 3 lines of text below the button
m_lblTemp->setAlignment(Qt::AlignCenter);
m_lblWind->setAlignment(Qt::AlignCenter);
@@ -232,13 +232,13 @@ void dockwidget::resizeView( const QSize &size )
{
if ( h <= 32 ) // left to right
{
- static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::LeftToRight);
+ static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
}
else // top to bottom
{
- static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::TopToBottom);
- QFontMetrics fm(m_font);
+ static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom);
+ TQFontMetrics fm(m_font);
h = QMIN(128, h) - fm.height();
m_lblTemp->setAlignment(Qt::AlignCenter);
}
@@ -259,18 +259,18 @@ void dockwidget::resizeView( const QSize &size )
{
if ( w <= 128 ) // top to bottom
{
- static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::TopToBottom);
+ static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom);
m_lblTemp->setAlignment(Qt::AlignCenter);
m_lblWind->setAlignment(Qt::AlignCenter);
m_lblPres->setAlignment(Qt::AlignCenter);
- QFontMetrics fm(m_font);
+ TQFontMetrics fm(m_font);
h = h - (3 * fm.height()); // 3 lines of text below the button
h = QMIN(w, h);
}
else // left to right layout
{
- static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::LeftToRight);
+ static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
m_lblWind->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
m_lblPres->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
@@ -281,14 +281,14 @@ void dockwidget::resizeView( const QSize &size )
{
if ( w <= 128 ) // top to bottom
{
- static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::TopToBottom);
+ static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::TopToBottom);
m_lblTemp->setAlignment(Qt::AlignCenter);
h = w;
}
else // left to right layout
{
- static_cast<QBoxLayout*>(layout())->setDirection(QBoxLayout::LeftToRight);
+ static_cast<TQBoxLayout*>(layout())->setDirection(TQBoxLayout::LeftToRight);
m_lblTemp->setAlignment(Qt::AlignAuto | Qt::AlignVCenter);
h = static_cast<int>(w * 0.33);
@@ -306,7 +306,7 @@ void dockwidget::resizeView( const QSize &size )
int dockwidget::widthForHeight(int h)
{
int w;
- QFontInfo fi(KGlobalSettings::generalFont());
+ TQFontInfo fi(KGlobalSettings::generalFont());
if ( m_mode == ShowAll )
{
@@ -315,7 +315,7 @@ int dockwidget::widthForHeight(int h)
int pixelSize = h/3 - 3;
pixelSize = QMIN(pixelSize, fi.pixelSize()); // don't make it too large
m_font.setPixelSize(pixelSize);
- QFontMetrics fm(m_font);
+ TQFontMetrics fm(m_font);
w = h + QMAX(fm.width(m_lblWind->text()), fm.width(m_lblPres->text())) + 1;
}
else // top to bottom
@@ -328,7 +328,7 @@ int dockwidget::widthForHeight(int h)
{
m_font.setPixelSize(h/2/3);
}
- QFontMetrics fm(m_font);
+ TQFontMetrics fm(m_font);
// size of icon
h = 128 - (3 * fm.height()); // 3 lines of text below the button
w = QMAX(fm.width(m_lblWind->text()), fm.width(m_lblPres->text())) + 1;
@@ -342,7 +342,7 @@ int dockwidget::widthForHeight(int h)
int pixelSize = h - 3;
pixelSize = QMIN(pixelSize, fi.pixelSize()); // don't make it too large
m_font.setPixelSize(pixelSize);
- QFontMetrics fm(m_font);
+ TQFontMetrics fm(m_font);
w = h + fm.width(m_lblTemp->text()) + 1;
}
else // top to bottom
@@ -355,7 +355,7 @@ int dockwidget::widthForHeight(int h)
{
m_font.setPixelSize(h/2);
}
- QFontMetrics fm(m_font);
+ TQFontMetrics fm(m_font);
// size of icon
h = QMIN(128, h) - fm.height();
w = fm.width(m_lblTemp->text()) + 1;
@@ -377,7 +377,7 @@ int dockwidget::heightForWidth( int w )
if ( m_mode == ShowAll )
{
- QFontMetrics fmg(KGlobalSettings::generalFont());
+ TQFontMetrics fmg(KGlobalSettings::generalFont());
int maxWidth = fmg.width("888 km/h NNWW"); // a good approximation
if ( w <= 128 ) // top to bottom
@@ -391,7 +391,7 @@ int dockwidget::heightForWidth( int w )
m_font.setPixelSize(static_cast<int>(fmg.height() * double(w) / maxWidth));
}
- QFontMetrics fm(m_font);
+ TQFontMetrics fm(m_font);
h = w + (3 * fm.height()); // 3 lines of text below the button
}
else
@@ -405,14 +405,14 @@ int dockwidget::heightForWidth( int w )
m_font.setPixelSize(static_cast<int>(fmg.height() * (w*0.66) / maxWidth));
}
- QFontMetrics fm(m_font);
+ TQFontMetrics fm(m_font);
h = 3 * fm.height(); // 3 lines of text
}
}
else if ( m_mode == ShowTempOnly )
{
- QFontMetrics fmg(KGlobalSettings::generalFont());
+ TQFontMetrics fmg(KGlobalSettings::generalFont());
int maxWidth = fmg.width("888.88 CC"); // a good approximation
if ( w <= 128 ) // top to bottom
@@ -426,7 +426,7 @@ int dockwidget::heightForWidth( int w )
m_font.setPixelSize(static_cast<int>(fmg.height() * double(w) / maxWidth));
}
- QFontMetrics fm(m_font);
+ TQFontMetrics fm(m_font);
h = w + fm.height(); // text below the button
}
else
@@ -440,7 +440,7 @@ int dockwidget::heightForWidth( int w )
m_font.setPixelSize(static_cast<int>(fmg.height() * (w*0.66) / maxWidth));
}
- QFontMetrics fm(m_font);
+ TQFontMetrics fm(m_font);
h = QMAX(fm.height(), static_cast<int>(w * 0.33));
}
}
diff --git a/kweather/dockwidget.h b/kweather/dockwidget.h
index f61f6b1..8a786b9 100644
--- a/kweather/dockwidget.h
+++ b/kweather/dockwidget.h
@@ -18,9 +18,9 @@
#ifndef DOCKWIDGET_H
#define DOCKWIDGET_H
-#include <qfont.h>
-#include <qpixmap.h>
-#include <qwidget.h>
+#include <tqfont.h>
+#include <tqpixmap.h>
+#include <tqwidget.h>
#include <dcopref.h>
@@ -33,16 +33,16 @@ class dockwidget : public QWidget
Q_OBJECT
public:
- dockwidget(const QString &location, QWidget *parent=0, const char *name=0);
+ dockwidget(const TQString &location, TQWidget *parent=0, const char *name=0);
~dockwidget();
enum {ShowIconOnly=1, ShowTempOnly=2, ShowAll=3 };
- void setLocationCode(const QString &locationCode);
+ void setLocationCode(const TQString &locationCode);
void setViewMode(int);
void setOrientation(Orientation o) { m_orientation = o; }
/** resize the view **/
- void resizeView(const QSize &size);
+ void resizeView(const TQSize &size);
int widthForHeight(int h);
int heightForWidth(int w);
@@ -57,13 +57,13 @@ private:
void updateFont();
int m_mode;
- QString m_locationCode;
- QFont m_font;
- QPixmap m_icon;
+ TQString m_locationCode;
+ TQFont m_font;
+ TQPixmap m_icon;
WeatherButton *m_button;
- QLabel *m_lblTemp;
- QLabel *m_lblWind;
- QLabel *m_lblPres;
+ TQLabel *m_lblTemp;
+ TQLabel *m_lblWind;
+ TQLabel *m_lblPres;
Orientation m_orientation;
WeatherService_stub *m_weatherService;
diff --git a/kweather/kcmweather.cpp b/kweather/kcmweather.cpp
index 26b029f..a4ed311 100644
--- a/kweather/kcmweather.cpp
+++ b/kweather/kcmweather.cpp
@@ -21,10 +21,10 @@
without including the source code for Qt in the source distribution.
*/
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
+#include <tqbuttongroup.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
#include <kaboutdata.h>
#include <kapplication.h>
@@ -43,18 +43,18 @@
extern "C"
{
- KDE_EXPORT KCModule *create_weather( QWidget *parent, const char * )
+ KDE_EXPORT KCModule *create_weather( TQWidget *parent, const char * )
{
return new KCMWeather( parent, "kweather" );
}
}
-KCMWeather::KCMWeather( QWidget *parent, const char *name )
+KCMWeather::KCMWeather( TQWidget *parent, const char *name )
: KCModule( parent, name )
{
mWeatherService = new WeatherService_stub( "KWeatherService",
"WeatherService" );
- QVBoxLayout *layout = new QVBoxLayout( this );
+ TQVBoxLayout *layout = new TQVBoxLayout( this );
mWidget = new prefsDialogData( this );
mWidget->m_reportLocation->setFocus();
@@ -63,14 +63,14 @@ KCMWeather::KCMWeather( QWidget *parent, const char *name )
fillStationList();
load();
- connect( mWidget->m_enableLog, SIGNAL( toggled( bool ) ),
- SLOT( enableLogWidgets( bool ) ) );
- connect( mWidget->m_viewMode, SIGNAL( released( int ) ),
- SLOT( changeViewMode( int ) ) );
- connect( mWidget->m_reportLocation, SIGNAL( activated( const QString& ) ),
- SLOT( reportLocationChanged() ) );
- connect( mWidget->m_textColor, SIGNAL( changed(const QColor &) ),
- SLOT( textColorChanged(const QColor &) ) );
+ connect( mWidget->m_enableLog, TQT_SIGNAL( toggled( bool ) ),
+ TQT_SLOT( enableLogWidgets( bool ) ) );
+ connect( mWidget->m_viewMode, TQT_SIGNAL( released( int ) ),
+ TQT_SLOT( changeViewMode( int ) ) );
+ connect( mWidget->m_reportLocation, TQT_SIGNAL( activated( const TQString& ) ),
+ TQT_SLOT( reportLocationChanged() ) );
+ connect( mWidget->m_textColor, TQT_SIGNAL( changed(const TQColor &) ),
+ TQT_SLOT( textColorChanged(const TQColor &) ) );
KAboutData *about = new KAboutData(
I18N_NOOP( "kcmweather" ),
@@ -86,7 +86,7 @@ KCMWeather::~KCMWeather()
{
delete mWeatherService;
}
-void KCMWeather::showEvent( QShowEvent * )
+void KCMWeather::showEvent( TQShowEvent * )
{
fillStationList();
}
@@ -94,12 +94,12 @@ void KCMWeather::showEvent( QShowEvent * )
void KCMWeather::fillStationList()
{
// store current selection
- QString current = mWidget->m_reportLocation->currentText();
+ TQString current = mWidget->m_reportLocation->currentText();
mWidget->m_reportLocation->clear();
- QStringList stationList = mWeatherService->listStations();
- QStringList::Iterator idx = stationList.begin();
+ TQStringList stationList = mWeatherService->listStations();
+ TQStringList::Iterator idx = stationList.begin();
// get station name from station id for sorting afterwards
for(; idx != stationList.end(); ++idx)
@@ -154,7 +154,7 @@ void KCMWeather::reportLocationChanged()
emit changed( true );
}
-void KCMWeather::textColorChanged(const QColor &)
+void KCMWeather::textColorChanged(const TQColor &)
{
emit changed( true );
}
@@ -169,11 +169,11 @@ void KCMWeather::load()
mWidget->m_enableLog->setChecked( enabled );
enableLogWidgets( enabled );
- static QColor black(Qt::black);
- QColor textColor = config.readColorEntry("textColor", &black);
+ static TQColor black(Qt::black);
+ TQColor textColor = config.readColorEntry("textColor", &black);
mWidget->m_textColor->setColor(textColor);
- QString loc = config.readEntry( "report_location" );
+ TQString loc = config.readEntry( "report_location" );
mWidget->m_logFile->setURL( config.readPathEntry( "log_file_name" ) );
@@ -196,7 +196,7 @@ void KCMWeather::save()
config.writeEntry( "textColor", mWidget->m_textColor->color() );
// Station idx to local idx; if nothing selected yet, keep it empty
- QString loc;
+ TQString loc;
if ( ! mWidget->m_reportLocation->currentText().isEmpty() )
loc = mWeatherService->stationCode( mWidget->m_reportLocation->currentText() );
config.writeEntry( "report_location", loc);
diff --git a/kweather/kcmweather.h b/kweather/kcmweather.h
index 4fe2326..0c90ed3 100644
--- a/kweather/kcmweather.h
+++ b/kweather/kcmweather.h
@@ -32,7 +32,7 @@ class KCMWeather : public KCModule
Q_OBJECT
public:
- KCMWeather( QWidget *parent = 0, const char *name = 0 );
+ KCMWeather( TQWidget *parent = 0, const char *name = 0 );
~KCMWeather();
virtual void load();
@@ -41,13 +41,13 @@ class KCMWeather : public KCModule
protected:
void fillStationList();
- virtual void showEvent( QShowEvent * );
+ virtual void showEvent( TQShowEvent * );
private slots:
void enableLogWidgets( bool value );
void changeViewMode( int mode );
void reportLocationChanged();
- void textColorChanged(const QColor &);
+ void textColorChanged(const TQColor &);
private:
prefsDialogData *mWidget;
diff --git a/kweather/kcmweatherservice.cpp b/kweather/kcmweatherservice.cpp
index ee7fb0f..16bd80a 100644
--- a/kweather/kcmweatherservice.cpp
+++ b/kweather/kcmweatherservice.cpp
@@ -21,7 +21,7 @@
without including the source code for Qt in the source distribution.
*/
-#include <qlayout.h>
+#include <tqlayout.h>
#include <kaboutdata.h>
#include <kdebug.h>
@@ -33,19 +33,19 @@
extern "C"
{
- KDE_EXPORT KCModule *create_weatherservice( QWidget *parent, const char * ) {
+ KDE_EXPORT KCModule *create_weatherservice( TQWidget *parent, const char * ) {
return new KCMWeatherService( parent, "kweather" );
}
}
-KCMWeatherService::KCMWeatherService( QWidget *parent, const char *name )
+KCMWeatherService::KCMWeatherService( TQWidget *parent, const char *name )
: KCModule( parent, name )
{
- QVBoxLayout *layout = new QVBoxLayout( this );
+ TQVBoxLayout *layout = new TQVBoxLayout( this );
mWidget = new ServiceConfigWidget( this );
// not needed, as a change immediately changes the service
- //connect(mWidget, SIGNAL(changed(bool)), this, SIGNAL(changed(bool)));
+ //connect(mWidget, TQT_SIGNAL(changed(bool)), this, TQT_SIGNAL(changed(bool)));
layout->addWidget( mWidget );
KAboutData *about = new KAboutData( "kcmweatherservice",
diff --git a/kweather/kcmweatherservice.h b/kweather/kcmweatherservice.h
index c5466d4..9dfb0bd 100644
--- a/kweather/kcmweatherservice.h
+++ b/kweather/kcmweatherservice.h
@@ -33,7 +33,7 @@ class KCMWeatherService : public KCModule
Q_OBJECT
public:
- KCMWeatherService( QWidget *parent = 0, const char *name = 0 );
+ KCMWeatherService( TQWidget *parent = 0, const char *name = 0 );
virtual void load();
virtual void save();
diff --git a/kweather/kweather.cpp b/kweather/kweather.cpp
index 5410b10..c6a7e9d 100644
--- a/kweather/kweather.cpp
+++ b/kweather/kweather.cpp
@@ -29,9 +29,9 @@
#include <ksettings/dispatcher.h>
#include <dcopclient.h>
-#include <qfile.h>
-#include <qtimer.h>
-#include <qpalette.h>
+#include <tqfile.h>
+#include <tqtimer.h>
+#include <tqpalette.h>
#include "kweather.h"
#include "reportview.h"
@@ -40,7 +40,7 @@
extern "C"
{
- KDE_EXPORT KPanelApplet* init(QWidget *parent, const QString& configFile)
+ KDE_EXPORT KPanelApplet* init(TQWidget *parent, const TQString& configFile)
{
KGlobal::locale()->insertCatalogue("kweather");
kweather *theApplet = new kweather(configFile, KPanelApplet::Normal,
@@ -49,8 +49,8 @@ extern "C"
}
}
-kweather::kweather(const QString& configFile, Type t, int actions,
- QWidget *parent, const char *name):
+kweather::kweather(const TQString& configFile, Type t, int actions,
+ TQWidget *parent, const char *name):
KPanelApplet(configFile, t, actions, parent, name), weatherIface(),
mFirstRun( false ), mReport( 0 ), mClient( 0 ),
mContextMenu( 0 ), mWeatherService( 0 ), settingsDialog( 0 ), mTextColor(Qt::black)
@@ -58,18 +58,18 @@ kweather::kweather(const QString& configFile, Type t, int actions,
kdDebug(12004) << "Constructor " << endl;
setObjId("weatherIface");
- setBackgroundOrigin( QWidget::AncestorOrigin );
+ setBackgroundOrigin( TQWidget::AncestorOrigin );
loadPrefs();
initContextMenu();
initDCOP();
dockWidget = new dockwidget(reportLocation, this, "dockwidget");
- connect(dockWidget, SIGNAL(buttonClicked()), SLOT(doReport()));
+ connect(dockWidget, TQT_SIGNAL(buttonClicked()), TQT_SLOT(doReport()));
dockWidget->setViewMode(mViewMode);
setLabelColor();
- timeOut = new QTimer(this, "timeOut" );
- connect(timeOut, SIGNAL(timeout()), SLOT(timeout()));
+ timeOut = new TQTimer(this, "timeOut" );
+ connect(timeOut, TQT_SIGNAL(timeout()), TQT_SLOT(timeout()));
timeOut->start(10*60*1000);
if(mFirstRun)
@@ -88,13 +88,13 @@ void kweather::initContextMenu()
mContextMenu = new KPopupMenu(this);
mContextMenu->insertTitle(i18n("KWeather - %1").arg( reportLocation ), -1, 0);
mContextMenu->insertItem(SmallIcon("viewmag"), i18n("Show &Report"),
- this, SLOT(doReport()), 0, -1, 1);
+ this, TQT_SLOT(doReport()), 0, -1, 1);
mContextMenu->insertItem(SmallIcon("reload"), i18n("&Update Now"),
- this, SLOT(slotUpdateNow()), 0, -1, 2);
+ this, TQT_SLOT(slotUpdateNow()), 0, -1, 2);
mContextMenu->insertSeparator();
- mContextMenu->insertItem(SmallIcon("kweather"), i18n("&About KWeather"), this, SLOT(about()));
+ mContextMenu->insertItem(SmallIcon("kweather"), i18n("&About KWeather"), this, TQT_SLOT(about()));
mContextMenu->insertItem(SmallIcon("configure"),
- i18n("&Configure KWeather..."), this, SLOT(preferences()));
+ i18n("&Configure KWeather..."), this, TQT_SLOT(preferences()));
setCustomMenu(mContextMenu);
}
@@ -116,8 +116,8 @@ void kweather::initDCOP()
mWeatherService = new WeatherService_stub( "KWeatherService", "WeatherService" );
- if (!connectDCOPSignal(0, 0, "fileUpdate(QString)",
- "refresh(QString)",false))
+ if (!connectDCOPSignal(0, 0, "fileUpdate(TQString)",
+ "refresh(TQString)",false))
kdDebug(12004) << "Could not attach dcop signal..." << endl;
else
kdDebug(12004) << "attached dcop signals..." << endl;
@@ -158,7 +158,7 @@ void kweather::preferences()
if ( settingsDialog == 0 )
{
settingsDialog = new KCMultiDialog( this );
- connect( settingsDialog, SIGNAL( configCommitted() ), SLOT( slotPrefsAccepted() ) );
+ connect( settingsDialog, TQT_SIGNAL( configCommitted() ), TQT_SLOT( slotPrefsAccepted() ) );
settingsDialog->addModule( "kcmweather.desktop" );
settingsDialog->addModule( "kcmweatherservice.desktop" );
@@ -171,7 +171,7 @@ void kweather::preferences()
/** The help handler */
void kweather::help()
{
- kapp->invokeHelp(QString::null, QString::fromLatin1("kweather"));
+ kapp->invokeHelp(TQString::null, TQString::fromLatin1("kweather"));
}
/** Display the current weather report. */
@@ -189,7 +189,7 @@ void kweather::doReport()
{
mReport = new reportView(reportLocation);
- connect( mReport, SIGNAL( finished() ), SLOT( slotReportFinished() ) );
+ connect( mReport, TQT_SIGNAL( finished() ), TQT_SLOT( slotReportFinished() ) );
}
mReport->show();
@@ -216,7 +216,7 @@ void kweather::loadPrefs(){
reportLocation = kcConfig->readEntry("report_location");
mViewMode = kcConfig->readNumEntry("smallview_mode", dockwidget::ShowAll);
- static QColor black(Qt::black);
+ static TQColor black(Qt::black);
mTextColor = kcConfig->readColorEntry("textColor", &black);
}
@@ -246,17 +246,17 @@ void kweather::writeLogEntry()
if (logOn && !fileName.isEmpty())
{
kdDebug(12004)<< "Try log file:" << fileName << endl;
- QFile logFile(fileName);
- QTextStream logFileStream(&logFile);
+ TQFile logFile(fileName);
+ TQTextStream logFileStream(&logFile);
if (logFile.open(IO_Append | IO_ReadWrite))
{
- QString temperature = mWeatherService->temperature(reportLocation );
- QString wind = mWeatherService->wind(reportLocation );
- QString pressure = mWeatherService->pressure(reportLocation );
- QString date = mWeatherService->date(reportLocation );
- QStringList weather = mWeatherService->weather(reportLocation );
- QStringList cover = mWeatherService->cover(reportLocation );
- QString visibility = mWeatherService->visibility(reportLocation );
+ TQString temperature = mWeatherService->temperature(reportLocation );
+ TQString wind = mWeatherService->wind(reportLocation );
+ TQString pressure = mWeatherService->pressure(reportLocation );
+ TQString date = mWeatherService->date(reportLocation );
+ TQStringList weather = mWeatherService->weather(reportLocation );
+ TQStringList cover = mWeatherService->cover(reportLocation );
+ TQString visibility = mWeatherService->visibility(reportLocation );
logFileStream << date << ",";
logFileStream << wind << ",";
logFileStream << temperature << ",";
@@ -312,7 +312,7 @@ int kweather::heightForWidth(int w) const
return h;
}
-void kweather::refresh(QString stationID)
+void kweather::refresh(TQString stationID)
{
kdDebug(12004) << "refresh " << stationID << endl;
if( stationID == reportLocation)
@@ -335,14 +335,14 @@ void kweather::slotPrefsAccepted()
if (logOn && !fileName.isEmpty())
{
- QFile logFile(fileName);
+ TQFile logFile(fileName);
// Open the file, create it if not already exists
if (logFile.open(IO_ReadWrite))
{
if (logFile.size() == 0)
{
// Empty file, put the header
- QTextStream logFileStream(&logFile);
+ TQTextStream logFileStream(&logFile);
logFileStream << "Date,Wind Speed & Direction,Temperature,Pressure,Cover,Visibility,Current Weather" << endl;
}
logFile.close();
@@ -361,7 +361,7 @@ void kweather::slotPrefsAccepted()
timeout();
}
-void kweather::mousePressEvent(QMouseEvent *e)
+void kweather::mousePressEvent(TQMouseEvent *e)
{
if ( e->button() != RightButton )
{
@@ -382,14 +382,14 @@ void kweather::slotUpdateNow()
bool kweather::attach()
{
- QString error;
+ TQString error;
kdDebug(12004) << "Looking for dcop service..." << endl;
if (!mClient->isApplicationRegistered("KWeatherService"))
{
kdDebug(12004) << "Could not find service so I am starting it..."
<< endl;
if (!KApplication::startServiceByDesktopName("kweatherservice",
- QStringList(), &error))
+ TQStringList(), &error))
{
kdDebug(12004) << "Starting KWeatherService failed with message: "
<< error << endl;
@@ -406,7 +406,7 @@ bool kweather::attach()
return true;
}
-void kweather::resizeEvent(QResizeEvent *e)
+void kweather::resizeEvent(TQResizeEvent *e)
{
kdDebug(12004) << "KWeather Resize event " << e->size() << endl;
dockWidget->resizeView(e->size());
@@ -417,7 +417,7 @@ void kweather::setLabelColor()
setPaletteForegroundColor(mTextColor);
}
-void kweather::paletteChange(const QPalette &)
+void kweather::paletteChange(const TQPalette &)
{
setLabelColor();
}
diff --git a/kweather/kweather.h b/kweather/kweather.h
index d139411..ae20317 100644
--- a/kweather/kweather.h
+++ b/kweather/kweather.h
@@ -35,13 +35,13 @@ class kweather : public KPanelApplet, public weatherIface
Q_OBJECT
public:
- kweather(const QString& configFile, Type t = Normal, int actions = 0, QWidget *parent = 0, const char *name = 0);
+ kweather(const TQString& configFile, Type t = Normal, int actions = 0, TQWidget *parent = 0, const char *name = 0);
~kweather();
void help();
- void resizeEvent(QResizeEvent*);
+ void resizeEvent(TQResizeEvent*);
int heightForWidth(int i) const;
int widthForHeight(int i) const;
- void refresh(QString);
+ void refresh(TQString);
void setBackground();
void setLabelColor();
@@ -50,7 +50,7 @@ public slots: // Public slots
void about();
protected:
- void paletteChange(const QPalette &);
+ void paletteChange(const TQPalette &);
protected slots:
void doReport();
@@ -66,17 +66,17 @@ private: // Private methods
void savePrefs();
void showWeather();
void writeLogEntry();
- void mousePressEvent(QMouseEvent *e);
+ void mousePressEvent(TQMouseEvent *e);
bool attach();
- QString reportLocation;
- QString fileName;
- QString metarData;
+ TQString reportLocation;
+ TQString fileName;
+ TQString metarData;
bool logOn;
bool mFirstRun;
int mViewMode;
- QTimer *timeOut;
+ TQTimer *timeOut;
dockwidget *dockWidget;
reportView *mReport;
DCOPClient *mClient;
@@ -84,7 +84,7 @@ private: // Private methods
KPopupMenu *mContextMenu;
WeatherService_stub *mWeatherService;
KCMultiDialog *settingsDialog;
- QColor mTextColor;
+ TQColor mTextColor;
};
#endif
diff --git a/kweather/metar_parser.cpp b/kweather/metar_parser.cpp
index 771d4d7..0339247 100644
--- a/kweather/metar_parser.cpp
+++ b/kweather/metar_parser.cpp
@@ -20,7 +20,7 @@ email : [email protected]
#include "config.h"
-#include <qdatetime.h>
+#include <tqdatetime.h>
#include <kdebug.h>
#include <math.h>
@@ -34,27 +34,27 @@ email : [email protected]
MetarParser::MetarParser(StationDatabase *stationDB,
KLocale::MeasureSystem units,
- QDate date,
- QTime time,
+ TQDate date,
+ TQTime time,
unsigned int localUTCOffset) :
m_stationDb(stationDB), m_units(units), m_date(date), m_time(time), m_localUTCOffset(localUTCOffset)
{
- CoverRegExp = QRegExp("^(FEW|SCT|BKN|OVC|SKC|CLR|CAVOK)([0-9]{3})?(?:TCU|CB)?$");
- CurrentRegExp = QRegExp("^(\\+|-|VC)?([A-Z]{2,4})$");
- WindRegExp = QRegExp("^([0-9]{3}|VRB)([0-9]{2,3})(?:G([0-9]{2,3}))?(KT|KMH|MPS)$");
- VisRegExp = QRegExp("^([0-9]{1,2})SM$");
- VisFracRegExp = QRegExp("^1/(2|4)SM$");
- TempRegExp = QRegExp("^(M)?([0-9]{2})/(?:(M)?([0-9]{2}))?$");
- TimeRegExp = QRegExp("^([0-9]{2}:[0-9]{2})$");
- DateRegExp = QRegExp("^([0-9]{4}/[0-9]{2}/[0-9]{2})$");
- PressRegExp = QRegExp("^([AQ])([0-9]{4})$");
- TempTenRegExp = QRegExp("^T([01][0-9]{3})([01][0-9]{3})$");
+ CoverRegExp = TQRegExp("^(FEW|SCT|BKN|OVC|SKC|CLR|CAVOK)([0-9]{3})?(?:TCU|CB)?$");
+ CurrentRegExp = TQRegExp("^(\\+|-|VC)?([A-Z]{2,4})$");
+ WindRegExp = TQRegExp("^([0-9]{3}|VRB)([0-9]{2,3})(?:G([0-9]{2,3}))?(KT|KMH|MPS)$");
+ VisRegExp = TQRegExp("^([0-9]{1,2})SM$");
+ VisFracRegExp = TQRegExp("^1/(2|4)SM$");
+ TempRegExp = TQRegExp("^(M)?([0-9]{2})/(?:(M)?([0-9]{2}))?$");
+ TimeRegExp = TQRegExp("^([0-9]{2}:[0-9]{2})$");
+ DateRegExp = TQRegExp("^([0-9]{4}/[0-9]{2}/[0-9]{2})$");
+ PressRegExp = TQRegExp("^([AQ])([0-9]{4})$");
+ TempTenRegExp = TQRegExp("^T([01][0-9]{3})([01][0-9]{3})$");
}
void MetarParser::reset()
{
// Initialize the WeatherInfo structure
- weatherInfo.theWeather = QString::null;
+ weatherInfo.theWeather = TQString::null;
weatherInfo.clouds = 0;
weatherInfo.windMPH = 0;
weatherInfo.tempC = 0;
@@ -64,19 +64,19 @@ void MetarParser::reset()
weatherInfo.qsCurrentList.clear();
weatherInfo.qsDate = m_date;
weatherInfo.qsTime = m_time;
- weatherInfo.qsPressure = QString::null;
- weatherInfo.qsTemperature = QString::null;
- weatherInfo.qsDewPoint = QString::null;
- weatherInfo.qsRelHumidity = QString::null;
- weatherInfo.qsVisibility = QString::null;
- weatherInfo.qsWindSpeed = QString::null;
- weatherInfo.qsWindChill = QString::null;
- weatherInfo.qsHeatIndex = QString::null;
- weatherInfo.qsWindDirection = QString::null;
+ weatherInfo.qsPressure = TQString::null;
+ weatherInfo.qsTemperature = TQString::null;
+ weatherInfo.qsDewPoint = TQString::null;
+ weatherInfo.qsRelHumidity = TQString::null;
+ weatherInfo.qsVisibility = TQString::null;
+ weatherInfo.qsWindSpeed = TQString::null;
+ weatherInfo.qsWindChill = TQString::null;
+ weatherInfo.qsHeatIndex = TQString::null;
+ weatherInfo.qsWindDirection = TQString::null;
weatherInfo.stationNeedsMaintenance = false;
}
-struct WeatherInfo MetarParser::processData(const QString &stationID, const QString &metar)
+struct WeatherInfo MetarParser::processData(const TQString &stationID, const TQString &metar)
{
reset();
@@ -85,11 +85,11 @@ struct WeatherInfo MetarParser::processData(const QString &stationID, const QStr
kdDebug(12006) << "Processing data: " << metar << endl;
// Split at whitespace into tokens
- QStringList dataList = QStringList::split(QRegExp("\\s+"), metar);
+ TQStringList dataList = TQStringList::split(TQRegExp("\\s+"), metar);
bool found = false;
bool beforeRemark = true;
- for (QStringList::ConstIterator it = dataList.begin();
+ for (TQStringList::ConstIterator it = dataList.begin();
it != dataList.end(); ++it)
{
// Don't try to parse the ICAO location code
@@ -143,17 +143,17 @@ struct WeatherInfo MetarParser::processData(const QString &stationID, const QStr
}
/** Parse the current cover type */
-bool MetarParser::parseCover(const QString &s)
+bool MetarParser::parseCover(const TQString &s)
{
if (CoverRegExp.search(s) > -1)
{
kdDebug(12006) << "Cover: " << CoverRegExp.capturedTexts().join("-")
<< endl;
- QString sCode = CoverRegExp.cap(1);
+ TQString sCode = CoverRegExp.cap(1);
float height = CoverRegExp.cap(2).toFloat(); // initially in 100's of feet
- QString sClouds;
- QString skycondition;
+ TQString sClouds;
+ TQString skycondition;
height *= 100;
if (m_units == KLocale::Metric)
@@ -203,13 +203,13 @@ bool MetarParser::parseCover(const QString &s)
}
/** Parse the current weather conditions */
-bool MetarParser::parseCurrent(const QString &s)
+bool MetarParser::parseCurrent(const TQString &s)
{
if (CurrentRegExp.search(s) > -1)
{
- QString sIntensity = CurrentRegExp.cap(1);
- QString sCode = CurrentRegExp.cap(2);
- QString intensity, descriptor, phenomena, currentWeather;
+ TQString sIntensity = CurrentRegExp.cap(1);
+ TQString sCode = CurrentRegExp.cap(2);
+ TQString intensity, descriptor, phenomena, currentWeather;
kdDebug(12006) << "Current: " << CurrentRegExp.capturedTexts().join("-") << endl;
@@ -354,7 +354,7 @@ bool MetarParser::parseCurrent(const QString &s)
}
/** Parse out the current temperature */
-bool MetarParser::parseTemperature(const QString &s)
+bool MetarParser::parseTemperature(const TQString &s)
{
if (TempRegExp.search(s) > -1)
{
@@ -375,7 +375,7 @@ bool MetarParser::parseTemperature(const QString &s)
return false;
}
-bool MetarParser::parseTemperatureTenths(const QString &s)
+bool MetarParser::parseTemperatureTenths(const TQString &s)
{
if (TempTenRegExp.search(s) > -1)
{
@@ -432,7 +432,7 @@ void MetarParser::calcTemperatureVariables()
fHeatIndex = 0;
}
- QString unit;
+ TQString unit;
if (m_units == KLocale::Metric)
{
unit = i18n("°C");
@@ -460,7 +460,7 @@ void MetarParser::calcTemperatureVariables()
weatherInfo.qsHeatIndex += unit;
}
-void MetarParser::removeTrailingDotZero(QString &string)
+void MetarParser::removeTrailingDotZero(TQString &string)
{
if ( string.right( 2 ) == ".0" )
{
@@ -469,20 +469,20 @@ void MetarParser::removeTrailingDotZero(QString &string)
}
/** Parse out the current date. */
-bool MetarParser::parseDate(const QString &s)
+bool MetarParser::parseDate(const TQString &s)
{
if (DateRegExp.search(s) > -1)
{
kdDebug(12006) << "Date: " << DateRegExp.capturedTexts().join("-")
<< endl;
- QString dateString = DateRegExp.cap(1);
- QString day, month, year;
+ TQString dateString = DateRegExp.cap(1);
+ TQString day, month, year;
day = dateString.mid(8,2);
month = dateString.mid(5,2);
year = dateString.mid(0,4);
- QDate theDate(year.toInt(), month.toInt(), day.toInt());
+ TQDate theDate(year.toInt(), month.toInt(), day.toInt());
weatherInfo.qsDate = theDate;
@@ -492,19 +492,19 @@ bool MetarParser::parseDate(const QString &s)
}
/** Parse out the current time. */
-bool MetarParser::parseTime(const QString &s)
+bool MetarParser::parseTime(const TQString &s)
{
if (TimeRegExp.search(s) > -1)
{
kdDebug(12006) << "Time: " << TimeRegExp.capturedTexts().join("-")
<< endl;
- QString hour, minute, dateString;
+ TQString hour, minute, dateString;
dateString = TimeRegExp.cap(1);
hour = dateString.mid(0,2);
minute = dateString.mid(3,2);
- QTime theTime(hour.toInt(), minute.toInt());
+ TQTime theTime(hour.toInt(), minute.toInt());
weatherInfo.qsTime = theTime;
return true;
@@ -513,7 +513,7 @@ bool MetarParser::parseTime(const QString &s)
}
/** Parse out the current visibility */
-bool MetarParser::parseVisibility(QStringList::ConstIterator it)
+bool MetarParser::parseVisibility(TQStringList::ConstIterator it)
{
float fVisibility = 0;
@@ -557,11 +557,11 @@ bool MetarParser::parseVisibility(QStringList::ConstIterator it)
}
/** Parse out the current pressure. */
-bool MetarParser::parsePressure( const QString &s)
+bool MetarParser::parsePressure( const TQString &s)
{
if (PressRegExp.search(s) > -1)
{
- QString type = PressRegExp.cap(1);
+ TQString type = PressRegExp.cap(1);
float fPressure = PressRegExp.cap(2).toFloat();
kdDebug(12006) << "Pressure: " << PressRegExp.capturedTexts().join("-")
@@ -591,7 +591,7 @@ bool MetarParser::parsePressure( const QString &s)
struct wind_info
{
unsigned int number;
- QString name;
+ TQString name;
};
static const struct wind_info wind_direction[] =
@@ -617,7 +617,7 @@ static const struct wind_info wind_direction[] =
};
-QString MetarParser::parseWindDirection(const unsigned int direction)
+TQString MetarParser::parseWindDirection(const unsigned int direction)
{
unsigned int i = 0;
@@ -634,14 +634,14 @@ QString MetarParser::parseWindDirection(const unsigned int direction)
}
/** Parse the wind speed */
-bool MetarParser::parseWindSpeed(const QString &s)
+bool MetarParser::parseWindSpeed(const TQString &s)
{
if (WindRegExp.search(s) > -1)
{
unsigned int direction = WindRegExp.cap(1).toInt();
float windSpeed = WindRegExp.cap(2).toFloat();
float gustSpeed = WindRegExp.cap(3).toFloat();
- QString sWindUnit = WindRegExp.cap(4);
+ TQString sWindUnit = WindRegExp.cap(4);
kdDebug(12006) << "Wind: " << WindRegExp.capturedTexts().join("-")
<< endl;
@@ -705,7 +705,7 @@ bool MetarParser::parseWindSpeed(const QString &s)
return false;
}
-bool MetarParser::parseStationNeedsMaintenance(const QString &s)
+bool MetarParser::parseStationNeedsMaintenance(const TQString &s)
{
if (s == "$")
{
@@ -815,11 +815,11 @@ void MetarParser::calcWindChill()
}
}
-bool MetarParser::isNight(const QString &stationID) const
+bool MetarParser::isNight(const TQString &stationID) const
{
- QString upperStationID = stationID.upper();
- QString latitude = m_stationDb->stationLatitudeFromID(upperStationID);
- QString longitude = m_stationDb->stationLongitudeFromID(upperStationID);
+ TQString upperStationID = stationID.upper();
+ TQString latitude = m_stationDb->stationLatitudeFromID(upperStationID);
+ TQString longitude = m_stationDb->stationLongitudeFromID(upperStationID);
if ( latitude.compare( i18n("Unknown Station" ) ) == 0 ||
longitude.compare( i18n("Unknown Station" ) ) == 0 )
@@ -830,10 +830,10 @@ bool MetarParser::isNight(const QString &stationID) const
{
Sun theSun( latitude, longitude , m_date, m_localUTCOffset );
- QTime currently = m_time;
+ TQTime currently = m_time;
- QTime civilStart = theSun.computeCivilTwilightStart();
- QTime civilEnd = theSun.computeCivilTwilightEnd();
+ TQTime civilStart = theSun.computeCivilTwilightStart();
+ TQTime civilEnd = theSun.computeCivilTwilightEnd();
kdDebug (12006) << "station, current, lat, lon, start, end, offset: " <<
upperStationID << " " << currently << " " << latitude << " " <<
@@ -859,9 +859,9 @@ bool MetarParser::isNight(const QString &stationID) const
}
}
-QString MetarParser::iconName( const QString &icon ) const
+TQString MetarParser::iconName( const TQString &icon ) const
{
- QString _iconName = icon;
+ TQString _iconName = icon;
if ( isNight( weatherInfo.reportLocation ) )
_iconName += "_night";
diff --git a/kweather/metar_parser.h b/kweather/metar_parser.h
index 946c34d..daeddad 100644
--- a/kweather/metar_parser.h
+++ b/kweather/metar_parser.h
@@ -22,35 +22,35 @@ email : [email protected]
#include <klocale.h>
#include <krfcdate.h>
-#include <qdatetime.h>
-#include <qregexp.h>
-#include <qstringlist.h>
+#include <tqdatetime.h>
+#include <tqregexp.h>
+#include <tqstringlist.h>
class StationDatabase;
struct WeatherInfo
{
/** The current weather state outside */
- QString theWeather;
+ TQString theWeather;
int clouds;
float windMPH;
float tempC;
float dewC;
bool heavy;
- QStringList qsCoverList;
- QStringList qsCurrentList;
- QDate qsDate;
- QString qsPressure;
- QString qsTemperature;
- QString qsDewPoint;
- QString qsRelHumidity;
- QTime qsTime;
- QString qsVisibility;
- QString qsWindSpeed;
- QString qsWindChill;
- QString qsHeatIndex;
- QString qsWindDirection;
- QString reportLocation;
+ TQStringList qsCoverList;
+ TQStringList qsCurrentList;
+ TQDate qsDate;
+ TQString qsPressure;
+ TQString qsTemperature;
+ TQString qsDewPoint;
+ TQString qsRelHumidity;
+ TQTime qsTime;
+ TQString qsVisibility;
+ TQString qsWindSpeed;
+ TQString qsWindChill;
+ TQString qsHeatIndex;
+ TQString qsWindDirection;
+ TQString reportLocation;
bool stationNeedsMaintenance;
};
@@ -60,8 +60,8 @@ class MetarParser
public:
MetarParser(StationDatabase *stationDB,
KLocale::MeasureSystem units = KLocale::Imperial,
- QDate date = QDate::currentDate(),
- QTime time = QTime::currentTime(),
+ TQDate date = TQDate::currentDate(),
+ TQTime time = TQTime::currentTime(),
unsigned int localUTCOffset = KRFCDate::localUTCOffset());
/*
@@ -73,26 +73,26 @@ class MetarParser
* latitude and longitude to calculate the sunrise and sunset time to see if
* the day or night icon should be used.
*/
- struct WeatherInfo processData(const QString &stationID, const QString &metar);
+ struct WeatherInfo processData(const TQString &stationID, const TQString &metar);
private:
- bool parseCover(const QString &s);
- bool parseCurrent(const QString &s);
- bool parseTemperature(const QString &s);
- bool parseTemperatureTenths(const QString &s);
+ bool parseCover(const TQString &s);
+ bool parseCurrent(const TQString &s);
+ bool parseTemperature(const TQString &s);
+ bool parseTemperatureTenths(const TQString &s);
void calcTemperatureVariables();
- void removeTrailingDotZero(QString &string);
- bool parseDate(const QString &s);
- bool parseTime(const QString &s);
- bool parseVisibility(QStringList::ConstIterator it);
- bool parsePressure( const QString &s );
- QString parseWindDirection(const unsigned int direction);
- bool parseWindSpeed(const QString &s);
- bool parseStationNeedsMaintenance(const QString &s);
+ void removeTrailingDotZero(TQString &string);
+ bool parseDate(const TQString &s);
+ bool parseTime(const TQString &s);
+ bool parseVisibility(TQStringList::ConstIterator it);
+ bool parsePressure( const TQString &s );
+ TQString parseWindDirection(const unsigned int direction);
+ bool parseWindSpeed(const TQString &s);
+ bool parseStationNeedsMaintenance(const TQString &s);
void calcCurrentIcon();
void calcWindChill();
- bool isNight(const QString &stationID) const;
- QString iconName( const QString &icon ) const;
+ bool isNight(const TQString &stationID) const;
+ TQString iconName( const TQString &icon ) const;
/*
* Reset the internal WeatherInfo struct of the class so that
@@ -102,22 +102,22 @@ class MetarParser
StationDatabase* const m_stationDb;
const KLocale::MeasureSystem m_units;
- const QDate m_date;
- const QTime m_time;
+ const TQDate m_date;
+ const TQTime m_time;
const unsigned int m_localUTCOffset;
struct WeatherInfo weatherInfo;
- QRegExp CoverRegExp;
- QRegExp CurrentRegExp;
- QRegExp WindRegExp;
- QRegExp VisRegExp;
- QRegExp VisFracRegExp;
- QRegExp TempRegExp;
- QRegExp TimeRegExp;
- QRegExp DateRegExp;
- QRegExp PressRegExp;
- QRegExp TempTenRegExp;
+ TQRegExp CoverRegExp;
+ TQRegExp CurrentRegExp;
+ TQRegExp WindRegExp;
+ TQRegExp VisRegExp;
+ TQRegExp VisFracRegExp;
+ TQRegExp TempRegExp;
+ TQRegExp TimeRegExp;
+ TQRegExp DateRegExp;
+ TQRegExp PressRegExp;
+ TQRegExp TempTenRegExp;
};
#endif
diff --git a/kweather/metar_parser_test.cpp b/kweather/metar_parser_test.cpp
index 8b79695..e442ef2 100644
--- a/kweather/metar_parser_test.cpp
+++ b/kweather/metar_parser_test.cpp
@@ -21,9 +21,9 @@
#include <iostream>
using namespace std;
-#include <qdatetime.h>
-#include <qfile.h>
-#include <qstringlist.h>
+#include <tqdatetime.h>
+#include <tqfile.h>
+#include <tqstringlist.h>
#include <krfcdate.h>
@@ -34,7 +34,7 @@ void test1();
void test2();
void displayWeatherInfo(const struct WeatherInfo &wi);
-const char *getString(const QString &str);
+const char *getString(const TQString &str);
int localUTCOffset = -300;
@@ -47,9 +47,9 @@ int main()
bool found = false;
// try the stations.dat file in the current directory first.
- QString path("stations.dat");
+ TQString path("stations.dat");
- if (QFile::exists(path))
+ if (TQFile::exists(path))
{
found = true;
}
@@ -61,10 +61,10 @@ int main()
// means that make install would have had to be done first before calling
// make check so that the file will be there.
- QString kdeDirs(getenv("KDEDIR"));
+ TQString kdeDirs(getenv("KDEDIR"));
path = kdeDirs + "/share/apps/kweatherservice/stations.dat";
- if (QFile::exists(path))
+ if (TQFile::exists(path))
{
found = true;
}
@@ -100,8 +100,8 @@ int main()
void test1()
{
- QDate Date(2004, 6, 17); // June 17th.
- QTime Time(21, 7); // hours, minutes, seconds and ms defaults to 0
+ TQDate Date(2004, 6, 17); // June 17th.
+ TQTime Time(21, 7); // hours, minutes, seconds and ms defaults to 0
// Construct a MetarParser object for our tests.
MetarParser parser( stationDb, KLocale::Imperial, Date, Time, localUTCOffset );
@@ -134,8 +134,8 @@ void test1()
void test2()
{
- QDate Date(2004, 6, 18); // June 18th.
- QTime Time(18, 43); // hours, minutes, seconds and ms defaults to 0
+ TQDate Date(2004, 6, 18); // June 18th.
+ TQTime Time(18, 43); // hours, minutes, seconds and ms defaults to 0
// Construct a MetarParser object for our tests.
MetarParser parser( stationDb, KLocale::Imperial, Date, Time, localUTCOffset );
@@ -176,13 +176,13 @@ void displayWeatherInfo(const struct WeatherInfo &wi)
cout << "heavy: " << wi.heavy << endl;
unsigned int i = 0;
- for ( QStringList::ConstIterator it = wi.qsCoverList.begin();
+ for ( TQStringList::ConstIterator it = wi.qsCoverList.begin();
it != wi.qsCoverList.end();
++it, i++ ) {
cout << "qsCoverList[" << i << "]: " << (*it).latin1() << endl;
}
i = 0;
- for ( QStringList::ConstIterator it = wi.qsCurrentList.begin();
+ for ( TQStringList::ConstIterator it = wi.qsCurrentList.begin();
it != wi.qsCurrentList.end();
++it, i++ ) {
cout << "qsCurrentList[" << i << "]: " << (*it).latin1() << endl;
@@ -205,7 +205,7 @@ void displayWeatherInfo(const struct WeatherInfo &wi)
static const char *nullString = "[null]";
-const char *getString(const QString &str)
+const char *getString(const TQString &str)
{
if (str.isNull())
{
diff --git a/kweather/reportmain.cpp b/kweather/reportmain.cpp
index 198263a..5a661a5 100644
--- a/kweather/reportmain.cpp
+++ b/kweather/reportmain.cpp
@@ -41,18 +41,18 @@ extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
DCOPClient *client = app.dcopClient();
client->attach();
- QString error;
+ TQString error;
if (!client->isApplicationRegistered("KWeatherService"))
{
if (KApplication::startServiceByDesktopName("kweatherservice",
- QStringList(), &error))
+ TQStringList(), &error))
{
kdDebug() << "Starting kweatherservice failed: " << error << endl;
return -2;
}
}
- QString reportLocation = args->arg( 0 );
+ TQString reportLocation = args->arg( 0 );
reportView *report = new reportView(reportLocation);
args->clear();
report->exec();
diff --git a/kweather/reportview.cpp b/kweather/reportview.cpp
index af37d9b..5cae65e 100644
--- a/kweather/reportview.cpp
+++ b/kweather/reportview.cpp
@@ -23,30 +23,30 @@
#include <khtmlview.h>
#include <kglobalsettings.h>
-#include <qvbox.h>
-#include <qpixmap.h>
-#include <qapplication.h>
+#include <tqvbox.h>
+#include <tqpixmap.h>
+#include <tqapplication.h>
#include "reportview.h"
#include "weatherservice_stub.h"
-reportView::reportView(const QString &reportLocation)
- : KDialogBase( (QWidget *)0, "report", false, QString::null, Close ),
+reportView::reportView(const TQString &reportLocation)
+ : KDialogBase( (TQWidget *)0, "report", false, TQString::null, Close ),
m_locationCode(reportLocation)
{
- QVBox *vbox = makeVBoxMainWidget();
+ TQVBox *vbox = makeVBoxMainWidget();
m_reportView = new KHTMLPart(vbox, "m_reportView");
KConfig config( "weather_panelappletrc" );
config.setGroup( "General Options" );
- QSize defaultSize( 450, 325 );
+ TQSize defaultSize( 450, 325 );
resize( config.readSizeEntry( "reportview_size", &defaultSize ) );
centerOnScreen( this );
m_weatherService = new WeatherService_stub( "KWeatherService", "WeatherService" );
- QPixmap icon = m_weatherService->icon( m_locationCode );
+ TQPixmap icon = m_weatherService->icon( m_locationCode );
setIcon( icon );
render();
@@ -55,7 +55,7 @@ reportView::reportView(const QString &reportLocation)
reportView::~reportView(){
delete m_weatherService;
// we do not have to delete m_reportView because this class is
- // the parent of the QVBox, and that is the parent of the KHTMLPart.
+ // the parent of the TQVBox, and that is the parent of the KHTMLPart.
KConfig config( "weather_panelappletrc" );
config.setGroup( "General Options" );
@@ -64,76 +64,76 @@ reportView::~reportView(){
/** Render the document */
void reportView::render(){
- QFont generalFont = KGlobalSettings::generalFont();
- QString fntFamily = generalFont.family();
+ TQFont generalFont = KGlobalSettings::generalFont();
+ TQString fntFamily = generalFont.family();
int fntSize = generalFont.pointSize();
if (fntSize == -1)
- fntSize = QFontInfo(generalFont).pointSize();
-
- QString textColor = KGlobalSettings::textColor().name();
- QString baseColor = KGlobalSettings::baseColor().name();
- QColorGroup cg = palette().active();
- QString bgColor = cg.background().name();
- QString hlColor = cg.highlight().name();
- QString hlTextColor = cg.highlightedText().name();
-
- QString locationName = m_weatherService->stationName(m_locationCode);
- QString countryName = m_weatherService->stationCountry(m_locationCode);
- QString temp = m_weatherService->temperature(m_locationCode);
- QString dewPoint = m_weatherService->dewPoint( m_locationCode);
- QString relHumidity = m_weatherService->relativeHumidity(m_locationCode );
- QString heatIndex = m_weatherService->heatIndex(m_locationCode );
- QString windChill = m_weatherService->windChill(m_locationCode );
- QString pressure = m_weatherService->pressure(m_locationCode );
- QString wind = m_weatherService->wind(m_locationCode );
- QString sunRiseTime = m_weatherService->sunRiseTime(m_locationCode );
- QString sunSetTime = m_weatherService->sunSetTime(m_locationCode );
- QString date = m_weatherService->date(m_locationCode );
- QString icon = m_weatherService->iconFileName(m_locationCode );
- QStringList cover = m_weatherService->cover(m_locationCode );
- QStringList weather = m_weatherService->weather(m_locationCode );
+ fntSize = TQFontInfo(generalFont).pointSize();
+
+ TQString textColor = KGlobalSettings::textColor().name();
+ TQString baseColor = KGlobalSettings::baseColor().name();
+ TQColorGroup cg = palette().active();
+ TQString bgColor = cg.background().name();
+ TQString hlColor = cg.highlight().name();
+ TQString hlTextColor = cg.highlightedText().name();
+
+ TQString locationName = m_weatherService->stationName(m_locationCode);
+ TQString countryName = m_weatherService->stationCountry(m_locationCode);
+ TQString temp = m_weatherService->temperature(m_locationCode);
+ TQString dewPoint = m_weatherService->dewPoint( m_locationCode);
+ TQString relHumidity = m_weatherService->relativeHumidity(m_locationCode );
+ TQString heatIndex = m_weatherService->heatIndex(m_locationCode );
+ TQString windChill = m_weatherService->windChill(m_locationCode );
+ TQString pressure = m_weatherService->pressure(m_locationCode );
+ TQString wind = m_weatherService->wind(m_locationCode );
+ TQString sunRiseTime = m_weatherService->sunRiseTime(m_locationCode );
+ TQString sunSetTime = m_weatherService->sunSetTime(m_locationCode );
+ TQString date = m_weatherService->date(m_locationCode );
+ TQString icon = m_weatherService->iconFileName(m_locationCode );
+ TQStringList cover = m_weatherService->cover(m_locationCode );
+ TQStringList weather = m_weatherService->weather(m_locationCode );
setCaption(i18n("Weather Report - %1").arg( locationName ) );
- QString weatherText = "<ul>\n";
+ TQString weatherText = "<ul>\n";
if ( m_weatherService->stationNeedsMaintenance( m_locationCode ) )
{
weatherText += "<li>" + i18n( "Station reports that it needs maintenance" ) + " \n";
}
- for (QStringList::const_iterator it = cover.begin();
+ for (TQStringList::const_iterator it = cover.begin();
it != cover.end(); ++it)
weatherText += "<li>" + *it + "\n";
- for (QStringList::const_iterator it = weather.begin();
+ for (TQStringList::const_iterator it = weather.begin();
it != weather.end(); ++it)
weatherText += "<li>" + *it + "\n";
weatherText += "</ul>\n";
- QString contents =
+ TQString contents =
"<html><head><style type=\"text/css\">" +
- QString("body { font-family: \"%1\"; font-size: %2pt; color: %3; background-color: %4; }\n")
+ TQString("body { font-family: \"%1\"; font-size: %2pt; color: %3; background-color: %4; }\n")
.arg(fntFamily).arg(fntSize).arg(textColor).arg(baseColor) +
- QString("div.headerTitle { background-color: %1; color: %2; padding: 4px; font-size: 120%; border: solid %3 1px; }\n")
+ TQString("div.headerTitle { background-color: %1; color: %2; padding: 4px; font-size: 120%; border: solid %3 1px; }\n")
.arg(hlColor).arg(hlTextColor).arg(textColor) +
- QString("div.headerMsg { background-color: %1; color: %2; border-bottom: solid %3 1px; "
+ TQString("div.headerMsg { background-color: %1; color: %2; border-bottom: solid %3 1px; "
"border-left: solid %4 1px; border-right: solid %5 1px; margin-bottom: 1em; padding: 2px; }\n")
.arg(bgColor).arg(textColor).arg(textColor).arg(textColor).arg(textColor) +
- QString("</style><title></title></head><body dir=\"%1\">").arg( QApplication::reverseLayout()?"rtl":"ltr") +
+ TQString("</style><title></title></head><body dir=\"%1\">").arg( TQApplication::reverseLayout()?"rtl":"ltr") +
"<div class=\"headerTitle\"><b>" + i18n( "Weather Report - %1 - %2" ).arg( locationName ).arg( countryName ) +
"</b></div>\n";
if ( ! date.isEmpty() )
contents += "<div class=\"headerMsg\"><b>" + i18n( "Latest data from %1" ).arg(date) + "</b></div>\n";
- contents += QString(
+ contents += TQString(
"<table><tr><td width=\"60\" style=\"text-align: center; border: dotted %1 1px;\">"
"<img width=\"64\" height=\"64\" src=\"%2\" /></td>"
"<td style=\"vertical-align: top\">%3</td></tr>")
.arg(bgColor).arg(KURL(icon).url()).arg(weatherText) +
"</table><table>" +
- QString("<tr><th style=\"text-align: right\">" + i18n( "Temperature:" )
+ TQString("<tr><th style=\"text-align: right\">" + i18n( "Temperature:" )
+ "</th><td>%1</td>"
"<td width=\"50\">&nbsp;</td>"
"<th style=\"text-align: right\">" + i18n( "Dew Point:" )
@@ -149,16 +149,16 @@ void reportView::render(){
.arg(wind) + "<td width=\"50\">&nbsp;</td>";
if (!heatIndex.isEmpty())
- contents += QString("<th style=\"text-align: right\">"
+ contents += TQString("<th style=\"text-align: right\">"
+ i18n( "Heat Index:" ) + "</th><td>%1</td>").arg(heatIndex);
else if (!windChill.isEmpty())
- contents += QString("<th style=\"text-align: right\">"
+ contents += TQString("<th style=\"text-align: right\">"
+ i18n( "Wind Chill:" ) + "</th><td>%1</td>").arg(windChill);
else
contents += "<td>&nbsp;</td><td>&nbsp;</td>";
contents += "</tr>";
- contents += QString("<tr><th style=\"text-align: right\">"
+ contents += TQString("<tr><th style=\"text-align: right\">"
+ i18n( "Sunrise:" ) + "</th><td>%1</td>" +
"<td width=\"50\">&nbsp;</td><th style=\"text-align: right\">"
+ i18n( "Sunset:" ) + "</th><td>%2</td>")
@@ -170,7 +170,7 @@ void reportView::render(){
m_reportView->write( contents );
m_reportView->end();
- QScrollView *view = m_reportView->view();
+ TQScrollView *view = m_reportView->view();
kdDebug() << "Size " << view->size().height() << "," << view->size().width() << endl;
kdDebug() << "Size " << view->visibleHeight() << "," << view->visibleWidth() << endl;
diff --git a/kweather/reportview.h b/kweather/reportview.h
index 569a071..5cbc082 100644
--- a/kweather/reportview.h
+++ b/kweather/reportview.h
@@ -19,7 +19,7 @@
#define REPORTVIEW_H
#include <kdialogbase.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
class KHTMLPart;
@@ -33,7 +33,7 @@ class reportView : public KDialogBase {
Q_OBJECT
public:
- reportView(const QString &reportLocation);
+ reportView(const TQString &reportLocation);
~reportView();
void render();
@@ -41,7 +41,7 @@ public:
private:
WeatherService_stub *m_weatherService;
KHTMLPart *m_reportView;
- QString m_locationCode;
+ TQString m_locationCode;
};
#endif
diff --git a/kweather/serviceconfigwidget.cpp b/kweather/serviceconfigwidget.cpp
index 5372984..27a1013 100644
--- a/kweather/serviceconfigwidget.cpp
+++ b/kweather/serviceconfigwidget.cpp
@@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qimage.h>
-#include <qheader.h>
+#include <tqimage.h>
+#include <tqheader.h>
#include <dcopclient.h>
#include <dcopref.h>
@@ -37,30 +37,30 @@
class StationItem : public QListViewItem
{
public:
- StationItem( QListView *view, const QString &name, const QString &uid )
- : QListViewItem( view, name ), mUID( uid )
+ StationItem( TQListView *view, const TQString &name, const TQString &uid )
+ : TQListViewItem( view, name ), mUID( uid )
{
}
- StationItem( QListViewItem *item, const QString &name, const QString &uid )
- : QListViewItem( item, name ), mUID( uid )
+ StationItem( TQListViewItem *item, const TQString &name, const TQString &uid )
+ : TQListViewItem( item, name ), mUID( uid )
{
}
- QString uid() const { return mUID; }
+ TQString uid() const { return mUID; }
private:
- QString mUID;
+ TQString mUID;
};
-static void parseStationEntry( const QString &line, QString &name, QString &uid );
+static void parseStationEntry( const TQString &line, TQString &name, TQString &uid );
-ServiceConfigWidget::ServiceConfigWidget( QWidget *parent, const char *name )
+ServiceConfigWidget::ServiceConfigWidget( TQWidget *parent, const char *name )
: wsPrefs( parent, name ), mService(0)
{
mService = new WeatherService_stub( "KWeatherService", "WeatherService" );
- connect( mAllStations, SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int ) ), SLOT( addStation() ) );
- connect( mSelectedStations, SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int ) ), SLOT( removeStation() ) );
+ connect( mAllStations, TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int ) ), TQT_SLOT( addStation() ) );
+ connect( mSelectedStations, TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int ) ), TQT_SLOT( removeStation() ) );
initGUI();
loadLocations();
@@ -125,16 +125,16 @@ void ServiceConfigWidget::scanStations()
if ( !dcopActive() )
return;
- QStringList list = mService->listStations( );
+ TQStringList list = mService->listStations( );
mSelectedStations->clear();
for ( uint i = 0; i < list.count(); ++i ) {
- QPixmap pm = mService->icon( list[ i ] );
- QImage img = pm.convertToImage();
+ TQPixmap pm = mService->icon( list[ i ] );
+ TQImage img = pm.convertToImage();
img = img.smoothScale( 22, 22 );
pm.convertFromImage( img );
- QString uid = list[ i ];
+ TQString uid = list[ i ];
if (mStationMap[ uid ].isEmpty())
{
mStationMap[ uid ] = uid;
@@ -145,7 +145,7 @@ void ServiceConfigWidget::scanStations()
}
}
-void ServiceConfigWidget::selectionChanged( QListViewItem *item )
+void ServiceConfigWidget::selectionChanged( TQListViewItem *item )
{
mRemoveButton->setEnabled( item != 0 );
}
@@ -166,34 +166,34 @@ void ServiceConfigWidget::loadLocations()
KConfig config( locate( "data", "kweatherservice/weather_stations.desktop" ) );
config.setGroup( "Main" );
- QStringList regions = QStringList::split( ' ', config.readEntry( "regions" ) );
+ TQStringList regions = TQStringList::split( ' ', config.readEntry( "regions" ) );
- QStringList::ConstIterator regionIt;
+ TQStringList::ConstIterator regionIt;
for ( regionIt = regions.begin(); regionIt != regions.end(); ++regionIt ) {
config.setGroup( *regionIt );
- QString name = config.readEntry( "name" );
- QStringList states = config.readListEntry( "states", ' ' );
+ TQString name = config.readEntry( "name" );
+ TQStringList states = config.readListEntry( "states", ' ' );
- QListViewItem *regionItem = new QListViewItem( mAllStations, name );
+ TQListViewItem *regionItem = new TQListViewItem( mAllStations, name );
regionItem->setSelectable( false );
- QStringList::ConstIterator stateIt;
+ TQStringList::ConstIterator stateIt;
for ( stateIt = states.begin(); stateIt != states.end(); ++stateIt ) {
config.setGroup( *regionIt + "_" + *stateIt );
- QString name = config.readEntry( "name" );
+ TQString name = config.readEntry( "name" );
- QListViewItem *stateItem = new QListViewItem( regionItem, name );
+ TQListViewItem *stateItem = new TQListViewItem( regionItem, name );
stateItem->setSelectable( false );
- QMap<QString, QString> entries = config.entryMap( *regionIt + "_" + *stateIt );
- QMap<QString, QString>::ConstIterator entryIt;
+ TQMap<TQString, TQString> entries = config.entryMap( *regionIt + "_" + *stateIt );
+ TQMap<TQString, TQString>::ConstIterator entryIt;
for ( entryIt = entries.begin(); entryIt != entries.end(); ++entryIt ) {
if ( entryIt.key() != "name" ) {
- QString station, uid;
+ TQString station, uid;
// get station and uid from the data
parseStationEntry( entryIt.data(), station, uid );
new StationItem( stateItem, station, uid );
- mStationMap.insert( uid, QString( "%1, %2" )
+ mStationMap.insert( uid, TQString( "%1, %2" )
.arg( station ).arg( *stateIt ) );
}
}
@@ -203,21 +203,21 @@ void ServiceConfigWidget::loadLocations()
bool ServiceConfigWidget::dcopActive()
{
- QString error;
- QCString appID;
+ TQString error;
+ TQCString appID;
bool isGood = true;
DCOPClient *client = kapp->dcopClient();
if ( !client->isApplicationRegistered( "KWeatherService" ) ) {
- if ( KApplication::startServiceByDesktopName( "kweatherservice", QStringList(), &error, &appID ) )
+ if ( KApplication::startServiceByDesktopName( "kweatherservice", TQStringList(), &error, &appID ) )
isGood = false;
}
return isGood;
}
-void parseStationEntry( const QString &line, QString &name, QString &uid )
+void parseStationEntry( const TQString &line, TQString &name, TQString &uid )
{
- QStringList list = QStringList::split( ' ', line );
+ TQStringList list = TQStringList::split( ' ', line );
bool inName = true;
diff --git a/kweather/serviceconfigwidget.h b/kweather/serviceconfigwidget.h
index f9b04f5..ed2726c 100644
--- a/kweather/serviceconfigwidget.h
+++ b/kweather/serviceconfigwidget.h
@@ -30,7 +30,7 @@ class ServiceConfigWidget : public wsPrefs
Q_OBJECT
public:
- ServiceConfigWidget( QWidget *parent, const char *name = 0 );
+ ServiceConfigWidget( TQWidget *parent, const char *name = 0 );
virtual ~ServiceConfigWidget();
signals:
@@ -42,7 +42,7 @@ class ServiceConfigWidget : public wsPrefs
void updateStations();
void exitWeatherService();
- void selectionChanged( QListViewItem* );
+ void selectionChanged( TQListViewItem* );
void modified();
private:
@@ -51,7 +51,7 @@ class ServiceConfigWidget : public wsPrefs
bool dcopActive();
void scanStations();
- QMap<QString, QString> mStationMap;
+ TQMap<TQString, TQString> mStationMap;
WeatherService_stub *mService;
};
diff --git a/kweather/sidebarwidget.cpp b/kweather/sidebarwidget.cpp
index fa2f008..0a7c080 100644
--- a/kweather/sidebarwidget.cpp
+++ b/kweather/sidebarwidget.cpp
@@ -20,14 +20,14 @@
*/
#include "sidebarwidget.h"
- #include <qscrollview.h>
+ #include <tqscrollview.h>
- sidebarwidget::sidebarwidget(QWidget* parent, const char* name) :
+ sidebarwidget::sidebarwidget(TQWidget* parent, const char* name) :
sidebarwidgetbase(parent,name)
{
- view = new QVBox(reportGrid->viewport());
+ view = new TQVBox(reportGrid->viewport());
reportGrid->addChild(view);
- reportGrid->setResizePolicy(QScrollView::AutoOneFit);
+ reportGrid->setResizePolicy(TQScrollView::AutoOneFit);
}
sidebarwidget::~sidebarwidget()
@@ -35,12 +35,12 @@
}
- void sidebarwidget::addWidget(QWidget *w, const QString &s)
+ void sidebarwidget::addWidget(TQWidget *w, const TQString &s)
{
w->setFixedWidth(reportGrid->visibleWidth ());
}
- QWidget *sidebarwidget::viewport()
+ TQWidget *sidebarwidget::viewport()
{
return view;
}
diff --git a/kweather/sidebarwidget.h b/kweather/sidebarwidget.h
index 0dbeb86..7bfb317 100644
--- a/kweather/sidebarwidget.h
+++ b/kweather/sidebarwidget.h
@@ -24,17 +24,17 @@
#include <sidebarwidgetbase.h>
-#include <qvbox.h>
+#include <tqvbox.h>
class sidebarwidget : public sidebarwidgetbase
{
Q_OBJECT
public:
- sidebarwidget(QWidget* parent, const char* name = 0);
+ sidebarwidget(TQWidget* parent, const char* name = 0);
virtual ~sidebarwidget();
- void addWidget(QWidget *w, const QString &s);
- QWidget *viewport();
- QVBox *view;
+ void addWidget(TQWidget *w, const TQString &s);
+ TQWidget *viewport();
+ TQVBox *view;
};
diff --git a/kweather/stationdatabase.cpp b/kweather/stationdatabase.cpp
index 00f13c1..0e2caac 100644
--- a/kweather/stationdatabase.cpp
+++ b/kweather/stationdatabase.cpp
@@ -12,21 +12,21 @@
//
#include "stationdatabase.h"
-#include <qstringlist.h>
-#include <qfile.h>
+#include <tqstringlist.h>
+#include <tqfile.h>
#include <kdebug.h>
class StationInfo
{
public:
- QString cityName;
- QString country;
- QString longitude;
- QString latitude;
+ TQString cityName;
+ TQString country;
+ TQString longitude;
+ TQString latitude;
StationInfo () {}
};
-StationDatabase::StationDatabase(const QString path) : mPath(path)
+StationDatabase::StationDatabase(const TQString path) : mPath(path)
{
}
@@ -35,21 +35,21 @@ StationDatabase::~StationDatabase()
{
}
-bool StationDatabase::loadStation( const QString & stationID )
+bool StationDatabase::loadStation( const TQString & stationID )
{
- QFile file( mPath );
+ TQFile file( mPath );
bool found = FALSE;
if ( !file.open( IO_ReadOnly ) )
return false;
- QTextStream stream( &file );
- stream.setEncoding( QTextStream::UnicodeUTF8 );
- QString line;
+ TQTextStream stream( &file );
+ stream.setEncoding( TQTextStream::UnicodeUTF8 );
+ TQString line;
while ( !stream.eof() )
{
line = stream.readLine(); // line of text excluding '\n'
- QStringList data = QStringList::split( ";", line, true );
+ TQStringList data = TQStringList::split( ";", line, true );
if ( data[ 0 ].stripWhiteSpace() == stationID )
{
@@ -70,11 +70,11 @@ bool StationDatabase::loadStation( const QString & stationID )
}
/*!
- \fn StationDatabase::stationNameFromID(const QString& id)
+ \fn StationDatabase::stationNameFromID(const TQString& id)
*/
-QString StationDatabase::stationNameFromID( const QString & stationID )
+TQString StationDatabase::stationNameFromID( const TQString & stationID )
{
- QString result;
+ TQString result;
if ( theDB.find( stationID ) == theDB.end() )
{
@@ -92,11 +92,11 @@ QString StationDatabase::stationNameFromID( const QString & stationID )
}
/*!
- \fn StationDatabase::stationLongitudeFromID( const QString &stationID)
+ \fn StationDatabase::stationLongitudeFromID( const TQString &stationID)
*/
-QString StationDatabase::stationLongitudeFromID( const QString & stationID )
+TQString StationDatabase::stationLongitudeFromID( const TQString & stationID )
{
- QString result;
+ TQString result;
if ( theDB.find( stationID ) == theDB.end() )
{
@@ -114,11 +114,11 @@ QString StationDatabase::stationLongitudeFromID( const QString & stationID )
}
/*!
- \fn StationDatabase::stationLatitudeFromID(const QString &stationID)
+ \fn StationDatabase::stationLatitudeFromID(const TQString &stationID)
*/
-QString StationDatabase::stationLatitudeFromID( const QString & stationID )
+TQString StationDatabase::stationLatitudeFromID( const TQString & stationID )
{
- QString result;
+ TQString result;
if ( theDB.find( stationID ) == theDB.end() )
{
@@ -136,11 +136,11 @@ QString StationDatabase::stationLatitudeFromID( const QString & stationID )
}
/*!
- \fn StationDatabase::stationCountryFromID( const QString &stationID)
+ \fn StationDatabase::stationCountryFromID( const TQString &stationID)
*/
-QString StationDatabase::stationCountryFromID( const QString &stationID )
+TQString StationDatabase::stationCountryFromID( const TQString &stationID )
{
- QString result;
+ TQString result;
if ( theDB.find( stationID ) == theDB.end() )
{
@@ -157,9 +157,9 @@ QString StationDatabase::stationCountryFromID( const QString &stationID )
return result;
}
-QString StationDatabase::stationIDfromName( const QString &name )
+TQString StationDatabase::stationIDfromName( const TQString &name )
{
- QMap<QString,StationInfo>::Iterator itr = theDB.begin();
+ TQMap<TQString,StationInfo>::Iterator itr = theDB.begin();
for( ; itr != theDB.end(); ++itr)
{
kdDebug() << "Checking " << itr.data().cityName << endl;
diff --git a/kweather/stationdatabase.h b/kweather/stationdatabase.h
index 1e020a9..f1fabe8 100644
--- a/kweather/stationdatabase.h
+++ b/kweather/stationdatabase.h
@@ -13,8 +13,8 @@
#ifndef STATIONDATABASE_H
#define STATIONDATABASE_H
-#include <qmap.h>
-#include <qstring.h>
+#include <tqmap.h>
+#include <tqstring.h>
#include <klocale.h>
#include <kstandarddirs.h>
@@ -30,25 +30,25 @@ class StationInfo;
class StationDatabase
{
public:
- StationDatabase(const QString path = locate("data", "kweatherservice/stations.dat"));
+ StationDatabase(const TQString path = locate("data", "kweatherservice/stations.dat"));
~StationDatabase();
- QString stationNameFromID(const QString& id);
+ TQString stationNameFromID(const TQString& id);
- QString stationLongitudeFromID( const QString &stationID);
+ TQString stationLongitudeFromID( const TQString &stationID);
- QString stationLatitudeFromID(const QString &stationID);
+ TQString stationLatitudeFromID(const TQString &stationID);
- QString stationCountryFromID( const QString &stationID);
+ TQString stationCountryFromID( const TQString &stationID);
- QString stationIDfromName( const QString &name );
+ TQString stationIDfromName( const TQString &name );
private:
- QMap<QString, StationInfo> theDB;
+ TQMap<TQString, StationInfo> theDB;
- bool loadStation( const QString & stationID );
+ bool loadStation( const TQString & stationID );
- const QString mPath;
+ const TQString mPath;
};
#endif
diff --git a/kweather/stationdatabase_test.cpp b/kweather/stationdatabase_test.cpp
index 902b7ab..fb33fc9 100644
--- a/kweather/stationdatabase_test.cpp
+++ b/kweather/stationdatabase_test.cpp
@@ -19,9 +19,9 @@
#include <cstdlib>
using namespace std;
-#include <qfile.h>
-#include <qstring.h>
-#include <qdatetime.h>
+#include <tqfile.h>
+#include <tqstring.h>
+#include <tqdatetime.h>
#include <krfcdate.h>
#include "stationdatabase.h"
@@ -33,9 +33,9 @@ int main()
bool found = false;
// try the stations.dat file in the current directory first.
- QString path("stations.dat");
+ TQString path("stations.dat");
- if (QFile::exists(path))
+ if (TQFile::exists(path))
{
found = true;
}
@@ -47,10 +47,10 @@ int main()
// means that make install would have had to be done first before calling
// make check so that the file will be there.
- QString kdeDirs(getenv("KDEDIR"));
+ TQString kdeDirs(getenv("KDEDIR"));
path = kdeDirs + "/share/apps/kweatherservice/stations.dat";
- if (QFile::exists(path))
+ if (TQFile::exists(path))
{
found = true;
}
diff --git a/kweather/sun.cpp b/kweather/sun.cpp
index 5c6fca1..8cabdb9 100644
--- a/kweather/sun.cpp
+++ b/kweather/sun.cpp
@@ -54,8 +54,8 @@ static inline double acosd(double x) { return RADEG * acos(x); }
static inline double atan2d(double y, double x) { return RADEG * atan2(y, x); }
/* Other local functions */
-static double latitudeToDouble( const QString &latitude );
-static double longitudeToDouble( const QString &longitude );
+static double latitudeToDouble( const TQString &latitude );
+static double longitudeToDouble( const TQString &longitude );
static int __sunriset__( int year, int month, int day, double lon, double lat,
double altit, int upper_limb, double &trise, double &tset );
static void sunpos( double d, double &lon, double &r );
@@ -87,7 +87,7 @@ static inline int civil_twilight(int year, int month, int day, double lon, doubl
}
-Sun::Sun(const QString &latitude, const QString &longitude, QDate date, const int localUTCOffset) :
+Sun::Sun(const TQString &latitude, const TQString &longitude, TQDate date, const int localUTCOffset) :
m_date(date),
m_lat(latitudeToDouble(latitude)), m_lon(longitudeToDouble(longitude)),
m_localUTCOffset(localUTCOffset)
@@ -95,14 +95,14 @@ Sun::Sun(const QString &latitude, const QString &longitude, QDate date, const in
}
-QTime Sun::computeRiseTime()
+TQTime Sun::computeRiseTime()
{
double riseTime;
double setTime;
sun_rise_set( m_date.year(), m_date.month(), m_date.day(), m_lon, m_lat, riseTime, setTime );
- QTime result = convertDoubleToLocalTime( riseTime );
+ TQTime result = convertDoubleToLocalTime( riseTime );
if ( ! result.isValid() )
result.setHMS( 6, 0, 0 );
@@ -111,14 +111,14 @@ QTime Sun::computeRiseTime()
}
-QTime Sun::computeSetTime()
+TQTime Sun::computeSetTime()
{
double riseTime;
double setTime;
sun_rise_set( m_date.year(), m_date.month(), m_date.day(), m_lon, m_lat, riseTime, setTime );
- QTime result = convertDoubleToLocalTime( setTime );
+ TQTime result = convertDoubleToLocalTime( setTime );
if ( ! result.isValid() )
result.setHMS( 19, 0, 0 );
@@ -127,14 +127,14 @@ QTime Sun::computeSetTime()
}
-QTime Sun::computeCivilTwilightStart()
+TQTime Sun::computeCivilTwilightStart()
{
double start;
double end;
civil_twilight( m_date.year(), m_date.month(), m_date.day(), m_lon, m_lat, start, end );
- QTime result = convertDoubleToLocalTime( start );
+ TQTime result = convertDoubleToLocalTime( start );
if ( ! result.isValid() )
result.setHMS( 6, 0, 0 );
@@ -143,14 +143,14 @@ QTime Sun::computeCivilTwilightStart()
}
-QTime Sun::computeCivilTwilightEnd()
+TQTime Sun::computeCivilTwilightEnd()
{
double start;
double end;
civil_twilight( m_date.year(), m_date.month(), m_date.day(), m_lon, m_lat, start, end );
- QTime result = convertDoubleToLocalTime( end );
+ TQTime result = convertDoubleToLocalTime( end );
if ( ! result.isValid() )
result.setHMS( 19, 0, 0 );
@@ -167,7 +167,7 @@ QTime Sun::computeCivilTwilightEnd()
*
* Does not currently handle seconds.
*/
-static double latitudeToDouble( const QString &latitude )
+static double latitudeToDouble( const TQString &latitude )
{
double result;
@@ -183,7 +183,7 @@ static double latitudeToDouble( const QString &latitude )
}
-static double longitudeToDouble( const QString &longitude )
+static double longitudeToDouble( const TQString &longitude )
{
double result;
@@ -199,9 +199,9 @@ static double longitudeToDouble( const QString &longitude )
}
-QTime Sun::convertDoubleToLocalTime( const double time )
+TQTime Sun::convertDoubleToLocalTime( const double time )
{
- QTime result;
+ TQTime result;
// Example: say time is 17.7543 Then hours = 17 and minutes = 0.7543 * 60 = 45.258
// We need to convert the time to CORRECT local hours
diff --git a/kweather/sun.h b/kweather/sun.h
index 6773d01..fd407d7 100644
--- a/kweather/sun.h
+++ b/kweather/sun.h
@@ -18,8 +18,8 @@
#ifndef SUN_H
#define SUN_H
-#include <qstring.h>
-#include <qdatetime.h>
+#include <tqstring.h>
+#include <tqdatetime.h>
#include <krfcdate.h>
class Sun
@@ -35,20 +35,20 @@ class Sun
* to the local time zone.
*
*/
- Sun( const QString &latitude,
- const QString &longitude,
- QDate date = QDate::currentDate(),
+ Sun( const TQString &latitude,
+ const TQString &longitude,
+ TQDate date = TQDate::currentDate(),
const int localUTCOffset = KRFCDate::localUTCOffset() );
- QTime computeRiseTime();
- QTime computeSetTime();
- QTime computeCivilTwilightStart();
- QTime computeCivilTwilightEnd();
+ TQTime computeRiseTime();
+ TQTime computeSetTime();
+ TQTime computeCivilTwilightStart();
+ TQTime computeCivilTwilightEnd();
private:
- QTime convertDoubleToLocalTime( const double time );
+ TQTime convertDoubleToLocalTime( const double time );
- const QDate m_date;
+ const TQDate m_date;
const double m_lat;
const double m_lon;
const int m_localUTCOffset;
diff --git a/kweather/sun_test.cpp b/kweather/sun_test.cpp
index d5dcccd..c9ce46c 100644
--- a/kweather/sun_test.cpp
+++ b/kweather/sun_test.cpp
@@ -18,8 +18,8 @@
#include <iostream>
using namespace std;
-#include <qstring.h>
-#include <qdatetime.h>
+#include <tqstring.h>
+#include <tqdatetime.h>
#include <krfcdate.h>
#include "sun.h"
@@ -29,16 +29,16 @@ int main()
{
bool anyFailed = false;
- QString KUGN_Latitude("42-25N");
- QString KUGN_Longitude("087-52W");
- QDate Date(2004, 6, 1); // June 1st.
+ TQString KUGN_Latitude("42-25N");
+ TQString KUGN_Longitude("087-52W");
+ TQDate Date(2004, 6, 1); // June 1st.
int localUTCOffset = -300;
// Construct a sun object for our tests.
Sun theSun( KUGN_Latitude, KUGN_Longitude, Date, localUTCOffset );
- QTime civilStart = theSun.computeCivilTwilightStart();
- QTime civilEnd = theSun.computeCivilTwilightEnd();
+ TQTime civilStart = theSun.computeCivilTwilightStart();
+ TQTime civilEnd = theSun.computeCivilTwilightEnd();
cout << "Testing Civil Twilight Calculations...";
// Start should be 04:42:39 End should be 20:56:06
@@ -55,8 +55,8 @@ int main()
cout << "Testing Rise and Set Time Calculations...";
- QTime rise = theSun.computeRiseTime();
- QTime set = theSun.computeSetTime();
+ TQTime rise = theSun.computeRiseTime();
+ TQTime set = theSun.computeSetTime();
// Rise should be 05:16:35 Set should be 20:22:10
if (rise.hour() == 5 && rise.minute() == 16 && rise.second() == 35 &&
diff --git a/kweather/weatherIface.h b/kweather/weatherIface.h
index 5f52b39..2120538 100644
--- a/kweather/weatherIface.h
+++ b/kweather/weatherIface.h
@@ -9,7 +9,7 @@ public:
k_dcop:
/** Cause KWeather to refrsh it's data **/
- virtual void refresh(QString) = 0;
+ virtual void refresh(TQString) = 0;
};
#endif
diff --git a/kweather/weatherbar.cpp b/kweather/weatherbar.cpp
index 2123a3a..c77333d 100644
--- a/kweather/weatherbar.cpp
+++ b/kweather/weatherbar.cpp
@@ -23,11 +23,11 @@
#include "dockwidget.h"
#include "sidebarwidget.h"
-#include <qlabel.h>
-#include <qfont.h>
-#include <qlayout.h>
-#include <qscrollview.h>
-#include <qgroupbox.h>
+#include <tqlabel.h>
+#include <tqfont.h>
+#include <tqlayout.h>
+#include <tqscrollview.h>
+#include <tqgroupbox.h>
#include <klocale.h>
#include <kdebug.h>
#include <kconfig.h>
@@ -36,9 +36,9 @@
#include <dcopref.h>
-KonqSidebarWeather::KonqSidebarWeather(KInstance* inst, QObject* parent,
- QWidget* widgetParent,
- QString& desktopName, const char* name)
+KonqSidebarWeather::KonqSidebarWeather(KInstance* inst, TQObject* parent,
+ TQWidget* widgetParent,
+ TQString& desktopName, const char* name)
: KonqSidebarPlugin(inst, parent, widgetParent, desktopName, name),
DCOPObject(name)
@@ -51,8 +51,8 @@ KonqSidebarWeather::KonqSidebarWeather(KInstance* inst, QObject* parent,
kdDebug() << "Get weatherstation list... " << endl;
if (!connectDCOPSignal(0,0,
- "fileUpdate(QString)",
- "refresh(QString)",false))
+ "fileUpdate(TQString)",
+ "refresh(TQString)",false))
kdDebug() << "Could not attach signal..." << endl;
else
kdDebug() << "attached dcop signals..." << endl;
@@ -60,7 +60,7 @@ KonqSidebarWeather::KonqSidebarWeather(KInstance* inst, QObject* parent,
DCOPRef dcopCall( "KWeatherService", "WeatherService" );
DCOPReply reply = dcopCall.call("listStations()", true );
if ( reply.isValid() ) {
- QStringList replyList = reply;
+ TQStringList replyList = reply;
for(int i = 0; i < replyList.size(); i++)
{
dockwidget *d = new dockwidget(m_container->viewport(), replyList[i].latin1());
@@ -68,13 +68,13 @@ KonqSidebarWeather::KonqSidebarWeather(KInstance* inst, QObject* parent,
d->resizeView(80,48);
d->show();
m_widgets.insert(replyList[i], d);
- dcopCall.send("update(QString)", replyList[i]);
+ dcopCall.send("update(TQString)", replyList[i]);
}
}
- timeOut = new QTimer(this, "timeOut" );
+ timeOut = new TQTimer(this, "timeOut" );
timeOut->changeInterval(15*60000);
- connect(timeOut, SIGNAL(timeout()), this, SLOT(update()));
+ connect(timeOut, TQT_SIGNAL(timeout()), this, TQT_SLOT(update()));
// m_widgets.append(new dockwidget(widgetParent));
}
@@ -83,30 +83,30 @@ KonqSidebarWeather::~KonqSidebarWeather()
{
}
-void* KonqSidebarWeather::provides(const QString&)
+void* KonqSidebarWeather::provides(const TQString&)
{
return 0;
}
-void KonqSidebarWeather::emitStatusBarText(const QString& s)
+void KonqSidebarWeather::emitStatusBarText(const TQString& s)
{
}
-QWidget* KonqSidebarWeather::getWidget()
+TQWidget* KonqSidebarWeather::getWidget()
{
return m_container;
}
-void KonqSidebarWeather::refresh(QString stationID)
+void KonqSidebarWeather::refresh(TQString stationID)
{
kdDebug() << "refresh " << stationID << endl;
if(m_widgets.find(stationID))
{
DCOPRef dcopCall( "KWeatherService", "WeatherService" );
- m_widgets[stationID]->setWeatherIcon(dcopCall.call("currentIcon(QString)", stationID ,true ));
- m_widgets[stationID]->setTemperature(dcopCall.call("temperature(QString)", stationID,true ));
- m_widgets[stationID]->setPressure(dcopCall.call("pressure(QString)", stationID,true ));
- m_widgets[stationID]->setWind(dcopCall.call("wind(QString)", stationID,true ));
+ m_widgets[stationID]->setWeatherIcon(dcopCall.call("currentIcon(TQString)", stationID ,true ));
+ m_widgets[stationID]->setTemperature(dcopCall.call("temperature(TQString)", stationID,true ));
+ m_widgets[stationID]->setPressure(dcopCall.call("pressure(TQString)", stationID,true ));
+ m_widgets[stationID]->setWind(dcopCall.call("wind(TQString)", stationID,true ));
m_widgets[stationID]->showWeather();
}
else
@@ -131,7 +131,7 @@ void KonqSidebarWeather::update()
DCOPRef dcopCall( "KWeatherService", "WeatherService" );
DCOPReply reply = dcopCall.call("listStations()", true );
if ( reply.isValid() ) {
- QStringList replyList = reply;
+ TQStringList replyList = reply;
for(int i = 0; i < replyList.size(); i++)
{
if(!m_widgets.find(replyList[i]))
@@ -141,7 +141,7 @@ void KonqSidebarWeather::update()
d->show();
m_widgets.insert(replyList[i], d);
}
- dcopCall.send("update(QString)", replyList[i]);
+ dcopCall.send("update(TQString)", replyList[i]);
}
}
timeOut->start(15*60000);
@@ -149,14 +149,14 @@ void KonqSidebarWeather::update()
extern "C"
{
- KDE_EXPORT void* create_weather_sidebar(KInstance* inst, QObject* par, QWidget*widp,
- QString& desktopname, const char* name)
+ KDE_EXPORT void* create_weather_sidebar(KInstance* inst, TQObject* par, TQWidget*widp,
+ TQString& desktopname, const char* name)
{
return new KonqSidebarWeather(inst, par, widp, desktopname, name);
}
- KDE_EXPORT bool add_weather_sidebar(QString* fn, QString* /*param*/,
- QMap<QString, QString>* map)
+ KDE_EXPORT bool add_weather_sidebar(TQString* fn, TQString* /*param*/,
+ TQMap<TQString, TQString>* map)
{
map->insert("Type","Link");
map->insert("Icon","weather_sidebar");
diff --git a/kweather/weatherbar.h b/kweather/weatherbar.h
index 80559ae..3f715c5 100644
--- a/kweather/weatherbar.h
+++ b/kweather/weatherbar.h
@@ -26,10 +26,10 @@
#include <kparts/part.h>
#include <kparts/factory.h>
#include <kparts/browserextension.h>
-#include <qdict.h>
+#include <tqdict.h>
#include <dcopobject.h>
-#include <qlayout.h>
-#include <qtimer.h>
+#include <tqlayout.h>
+#include <tqtimer.h>
class dockwidget;
class sidebarwidget;
@@ -39,16 +39,16 @@ class KonqSidebarWeather: public KonqSidebarPlugin, virtual public DCOPObject
Q_OBJECT
K_DCOP
public:
- KonqSidebarWeather(KInstance* inst, QObject* parent, QWidget* widgetParent,
- QString& desktopName_, const char* name = 0);
+ KonqSidebarWeather(KInstance* inst, TQObject* parent, TQWidget* widgetParent,
+ TQString& desktopName_, const char* name = 0);
~KonqSidebarWeather();
- virtual void* provides(const QString&);
- void emitStatusBarText(const QString&);
- virtual QWidget *getWidget();
+ virtual void* provides(const TQString&);
+ void emitStatusBarText(const TQString&);
+ virtual TQWidget *getWidget();
k_dcop:
- virtual void refresh(QString);
+ virtual void refresh(TQString);
protected:
virtual void handleURL(const KURL &url);
@@ -59,9 +59,9 @@ private slots:
void update();
private:
- QDict <dockwidget> m_widgets;
+ TQDict <dockwidget> m_widgets;
sidebarwidget *m_container;
- QTimer *timeOut;
+ TQTimer *timeOut;
};
#endif
diff --git a/kweather/weatherbutton.cpp b/kweather/weatherbutton.cpp
index 7ae680c..3cbdebe 100644
--- a/kweather/weatherbutton.cpp
+++ b/kweather/weatherbutton.cpp
@@ -19,7 +19,7 @@
#include "weatherbutton.h"
-#include <qpainter.h>
+#include <tqpainter.h>
#include <kapplication.h>
#include <kcursor.h>
@@ -29,15 +29,15 @@
#include <kipc.h>
#include <kstandarddirs.h>
-WeatherButton::WeatherButton( QWidget *parent, const char *name )
- : QButton( parent, name ), m_highlight( false )
+WeatherButton::WeatherButton( TQWidget *parent, const char *name )
+ : TQButton( parent, name ), m_highlight( false )
{
setBackgroundOrigin( AncestorOrigin );
- connect( kapp, SIGNAL( settingsChanged( int ) ),
- SLOT( slotSettingsChanged( int ) ) );
- connect( kapp, SIGNAL( iconChanged( int ) ),
- SLOT( slotIconChanged( int ) ) );
+ connect( kapp, TQT_SIGNAL( settingsChanged( int ) ),
+ TQT_SLOT( slotSettingsChanged( int ) ) );
+ connect( kapp, TQT_SIGNAL( iconChanged( int ) ),
+ TQT_SLOT( slotIconChanged( int ) ) );
kapp->addKipcEventMask( KIPC::SettingsChanged );
kapp->addKipcEventMask( KIPC::IconChanged );
@@ -45,19 +45,19 @@ WeatherButton::WeatherButton( QWidget *parent, const char *name )
slotSettingsChanged( KApplication::SETTINGS_MOUSE );
}
-void WeatherButton::drawButton( QPainter *p )
+void WeatherButton::drawButton( TQPainter *p )
{
drawButtonLabel(p);
}
-void WeatherButton::drawButtonLabel( QPainter *p )
+void WeatherButton::drawButtonLabel( TQPainter *p )
{
if (!pixmap())
{
return;
}
- QPixmap pix = m_highlight? m_activeIcon : m_normalIcon;
+ TQPixmap pix = m_highlight? m_activeIcon : m_normalIcon;
if (isOn() || isDown())
{
@@ -70,7 +70,7 @@ void WeatherButton::drawButtonLabel( QPainter *p )
int ph = pix.height();
int pw = pix.width();
int margin = 3;
- QPoint origin(margin / 2, margin / 2);
+ TQPoint origin(margin / 2, margin / 2);
if (ph < (h - margin))
{
@@ -86,9 +86,9 @@ void WeatherButton::drawButtonLabel( QPainter *p )
}
-void WeatherButton::setPixmap( const QPixmap &pix )
+void WeatherButton::setPixmap( const TQPixmap &pix )
{
- QButton::setPixmap( pix );
+ TQButton::setPixmap( pix );
generateIcons();
}
@@ -97,8 +97,8 @@ void WeatherButton::generateIcons()
if ( !pixmap() )
return;
- QImage image = pixmap()->convertToImage();
- image = image.smoothScale( pixmapSize(), QImage::ScaleMin );
+ TQImage image = pixmap()->convertToImage();
+ image = image.smoothScale( pixmapSize(), TQImage::ScaleMin );
KIconEffect effect;
@@ -127,31 +127,31 @@ void WeatherButton::slotIconChanged( int group )
repaint( false );
}
-void WeatherButton::enterEvent( QEvent *e )
+void WeatherButton::enterEvent( TQEvent *e )
{
m_highlight = true;
repaint( false );
- QButton::enterEvent( e );
+ TQButton::enterEvent( e );
}
-void WeatherButton::leaveEvent( QEvent *e )
+void WeatherButton::leaveEvent( TQEvent *e )
{
m_highlight = false;
repaint( false );
- QButton::enterEvent( e );
+ TQButton::enterEvent( e );
}
-void WeatherButton::resizeEvent( QResizeEvent * )
+void WeatherButton::resizeEvent( TQResizeEvent * )
{
generateIcons();
}
-QPoint WeatherButton::pixmapOrigin() const
+TQPoint WeatherButton::pixmapOrigin() const
{
- QSize point = margin()/2;
- QPoint origin( point.width(), point.height() );
+ TQSize point = margin()/2;
+ TQPoint origin( point.width(), point.height() );
return origin;
}
diff --git a/kweather/weatherbutton.h b/kweather/weatherbutton.h
index d846169..59f6f88 100644
--- a/kweather/weatherbutton.h
+++ b/kweather/weatherbutton.h
@@ -20,32 +20,32 @@
#ifndef WEATHERBUTTON_H
#define WEATHERBUTTON_H
-#include <qbutton.h>
-#include <qpixmap.h>
+#include <tqbutton.h>
+#include <tqpixmap.h>
class WeatherButton : public QButton
{
Q_OBJECT
public:
- WeatherButton( QWidget *parent, const char *name );
- void setPixmap( const QPixmap &pix );
+ WeatherButton( TQWidget *parent, const char *name );
+ void setPixmap( const TQPixmap &pix );
protected:
- void drawButton( QPainter *p );
- void drawButtonLabel( QPainter *p );
- QSize margin() const { return QSize( 3, 3 ); }
- QSize pixmapSize() const { return size() - margin()*2; }
- QPoint pixmapOrigin() const;
+ void drawButton( TQPainter *p );
+ void drawButtonLabel( TQPainter *p );
+ TQSize margin() const { return TQSize( 3, 3 ); }
+ TQSize pixmapSize() const { return size() - margin()*2; }
+ TQPoint pixmapOrigin() const;
void generateIcons();
- void enterEvent( QEvent *e );
- void leaveEvent( QEvent *e );
- void resizeEvent( QResizeEvent *e );
+ void enterEvent( TQEvent *e );
+ void leaveEvent( TQEvent *e );
+ void resizeEvent( TQResizeEvent *e );
bool m_highlight;
- QPixmap m_normalIcon;
- QPixmap m_activeIcon;
+ TQPixmap m_normalIcon;
+ TQPixmap m_activeIcon;
protected slots:
void slotSettingsChanged( int category );
diff --git a/kweather/weatherlib.cpp b/kweather/weatherlib.cpp
index cb79a05..c06e89a 100644
--- a/kweather/weatherlib.cpp
+++ b/kweather/weatherlib.cpp
@@ -16,9 +16,9 @@ email : [email protected]
***************************************************************************/
#include "config.h"
-#include <qfile.h>
-#include <qdatetime.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqdatetime.h>
+#include <tqtextstream.h>
#include <kglobal.h>
#include <klocale.h>
#include <kdebug.h>
@@ -50,7 +50,7 @@ class WeatherLib::Data
/** The current weather state outside */
struct WeatherInfo wi;
- QDateTime age;
+ TQDateTime age;
KTempFile *target;
bool downloading;
bool updated;
@@ -65,7 +65,7 @@ WeatherLib::Data::Data()
void WeatherLib::Data::clear()
{
- age = QDateTime::currentDateTime();
+ age = TQDateTime::currentDateTime();
downloading = false;
updated = false;
job = 0;
@@ -77,8 +77,8 @@ void WeatherLib::Data::clear()
}
}
-WeatherLib::WeatherLib(StationDatabase *stationDB, QObject *parent, const char *name)
- : QObject (parent, name)
+WeatherLib::WeatherLib(StationDatabase *stationDB, TQObject *parent, const char *name)
+ : TQObject (parent, name)
{
KGlobal::locale()->insertCatalogue("kweather");
@@ -106,7 +106,7 @@ void WeatherLib::slotCopyDone(KIO::Job* job)
}
}
// Find the job
- QDictIterator<Data> it( data );
+ TQDictIterator<Data> it( data );
Data *d = 0L;
for( ; it.current(); ++it )
{
@@ -118,13 +118,13 @@ void WeatherLib::slotCopyDone(KIO::Job* job)
if( !job->error() )
{
kdDebug( 12006) << "Reading: " << d->target->name() << endl;
- QFile file( d->target->name() );
+ TQFile file( d->target->name() );
file.open( IO_ReadOnly );
- QTextStream *t = new QTextStream( &file );
- //QTextStream *t = d->target->textStream();
+ TQTextStream *t = new TQTextStream( &file );
+ //TQTextStream *t = d->target->textStream();
if( t )
{
- QString s = QString::null;
+ TQString s = TQString::null;
while ( !t->eof() )
{
s += " " + t->readLine();
@@ -135,7 +135,7 @@ void WeatherLib::slotCopyDone(KIO::Job* job)
kdDebug( 12006 ) << "Parse: " << s << endl;
MetarParser parser(m_StationDb, KGlobal::locale()->measureSystem());
d->wi = parser.processData(d->wi.reportLocation, s);
- d->age = QDateTime::currentDateTime().addSecs(1800);
+ d->age = TQDateTime::currentDateTime().addSecs(1800);
emit fileUpdate(d->wi.reportLocation);
d->updated = true;
}
@@ -193,11 +193,11 @@ void WeatherLib::getData(Data *d, bool force /* try even if host was down last t
{
d->downloading = true;
d->updated = false;
- QString u = "http://weather.noaa.gov/pub/data/observations/metar/stations/";
+ TQString u = "http://weather.noaa.gov/pub/data/observations/metar/stations/";
u += d->wi.reportLocation.upper().stripWhiteSpace();
u += ".TXT";
- d->target = new KTempFile(QString::null, "-weather");
+ d->target = new KTempFile(TQString::null, "-weather");
d->target->setAutoDelete(true);
d->target->file();
@@ -206,15 +206,15 @@ void WeatherLib::getData(Data *d, bool force /* try even if host was down last t
d->job = KIO::file_copy( url, local, -1, true, false, false);
d->job->addMetaData("cache", "reload"); // Make sure to get fresh info
- connect( d->job, SIGNAL( result( KIO::Job *)),
- SLOT(slotCopyDone(KIO::Job *)));
+ connect( d->job, TQT_SIGNAL( result( KIO::Job *)),
+ TQT_SLOT(slotCopyDone(KIO::Job *)));
kdDebug( 12006 ) << "Copying " << url.prettyURL() << " to "
<< local.prettyURL() << endl;
emit fileUpdating(d->wi.reportLocation);
}
}
-WeatherLib::Data* WeatherLib::findData(const QString &stationID)
+WeatherLib::Data* WeatherLib::findData(const TQString &stationID)
{
Data *d = data[stationID];
if (!d)
@@ -230,45 +230,45 @@ WeatherLib::Data* WeatherLib::findData(const QString &stationID)
return d;
}
-QString WeatherLib::temperature(const QString &stationID){
+TQString WeatherLib::temperature(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsTemperature;
}
-QString WeatherLib::pressure(const QString &stationID){
+TQString WeatherLib::pressure(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsPressure;
}
-QString WeatherLib::wind(const QString &stationID){
+TQString WeatherLib::wind(const TQString &stationID){
Data *d = findData(stationID);
return (d->wi.qsWindSpeed + " " + d->wi.qsWindDirection);
}
/** */
-QString WeatherLib::dewPoint(const QString &stationID){
+TQString WeatherLib::dewPoint(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsDewPoint;
}
-QString WeatherLib::relHumidity(const QString &stationID){
+TQString WeatherLib::relHumidity(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsRelHumidity;
}
-QString WeatherLib::heatIndex(const QString &stationID){
+TQString WeatherLib::heatIndex(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsHeatIndex;
}
-QString WeatherLib::windChill(const QString &stationID){
+TQString WeatherLib::windChill(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsWindChill;
}
-QString WeatherLib::iconName(const QString &stationID){
+TQString WeatherLib::iconName(const TQString &stationID){
- QString result("dunno");
+ TQString result("dunno");
// isEmpty is true for null or 0 length strings
if ( !stationID.isEmpty() )
@@ -280,49 +280,49 @@ QString WeatherLib::iconName(const QString &stationID){
return result;
}
-QString WeatherLib::date(const QString &stationID){
+TQString WeatherLib::date(const TQString &stationID){
Data *d = findData(stationID);
if ( ! d->wi.qsDate.isValid() )
return "";
else
{
- QDateTime gmtDateTime(d->wi.qsDate, d->wi.qsTime);
- QDateTime localDateTime = gmtDateTime.addSecs(KRFCDate::localUTCOffset() * 60);
+ TQDateTime gmtDateTime(d->wi.qsDate, d->wi.qsTime);
+ TQDateTime localDateTime = gmtDateTime.addSecs(KRFCDate::localUTCOffset() * 60);
return KGlobal::locale()->formatDateTime(localDateTime, false, false);
}
}
/** Returns the current cover */
-QStringList WeatherLib::cover(const QString &stationID){
+TQStringList WeatherLib::cover(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsCoverList;
}
/** return the visibility */
-QString WeatherLib::visibility(const QString &stationID){
+TQString WeatherLib::visibility(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsVisibility;
}
/** return the weather text */
-QStringList WeatherLib::weather(const QString &stationID){
+TQStringList WeatherLib::weather(const TQString &stationID){
Data *d = findData(stationID);
return d->wi.qsCurrentList;
}
-bool WeatherLib::stationNeedsMaintenance(const QString &stationID)
+bool WeatherLib::stationNeedsMaintenance(const TQString &stationID)
{
Data *d = findData(stationID);
return d->wi.stationNeedsMaintenance;
}
-void WeatherLib::update(const QString &stationID)
+void WeatherLib::update(const TQString &stationID)
{
// Only grab new data if its more than 50 minutes old
Data *d = findData(stationID);
- QDateTime timeout = QDateTime::currentDateTime();
+ TQDateTime timeout = TQDateTime::currentDateTime();
kdDebug (12006) << "Current Time: " << KGlobal::locale()->formatDateTime(timeout, false, false) <<
" Update at: " << KGlobal::locale()->formatDateTime(d->age, false, false) << endl;
@@ -332,23 +332,23 @@ void WeatherLib::update(const QString &stationID)
emit fileUpdate(d->wi.reportLocation);
}
-QStringList WeatherLib::stations()
+TQStringList WeatherLib::stations()
{
- QStringList l;
- QDictIterator<Data> it( data );
+ TQStringList l;
+ TQDictIterator<Data> it( data );
for( ; it.current(); ++it )
l += it.currentKey();
return l;
}
-void WeatherLib::forceUpdate(const QString &stationID)
+void WeatherLib::forceUpdate(const TQString &stationID)
{
hostDown = false; // we want to show error message if host is still down
Data *d = findData(stationID);
getData( d );
}
-void WeatherLib::remove(const QString &stationID)
+void WeatherLib::remove(const TQString &stationID)
{
data.remove(stationID);
emit stationRemoved(stationID);
diff --git a/kweather/weatherlib.h b/kweather/weatherlib.h
index 723e3dc..5b4e92f 100644
--- a/kweather/weatherlib.h
+++ b/kweather/weatherlib.h
@@ -17,10 +17,10 @@
#ifndef WEATHERLIB_H
#define WEATHERLIB_H
-#include <qobject.h>
-#include <qstring.h>
-#include <qregexp.h>
-#include <qdict.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqregexp.h>
+#include <tqdict.h>
namespace KIO
{
@@ -36,47 +36,47 @@ class WeatherLib : public QObject
public:
class Data;
- WeatherLib(StationDatabase *stationDB, QObject *parent =0L, const char *name =0L);
+ WeatherLib(StationDatabase *stationDB, TQObject *parent =0L, const char *name =0L);
virtual ~WeatherLib();
- QString temperature(const QString &stationID);
- QString dewPoint(const QString &stationID);
- QString relHumidity(const QString &stationID);
- QString heatIndex(const QString &stationID);
- QString windChill(const QString &stationID);
- QString wind(const QString &stationID);
- QString pressure(const QString &stationID);
- QString iconName(const QString &stationID);
- QString date(const QString &stationID);
- QStringList weather(const QString &stationID);
- QString visibility(const QString &stationID);
- QStringList cover(const QString &stationID);
- bool stationNeedsMaintenance(const QString &stationID);
+ TQString temperature(const TQString &stationID);
+ TQString dewPoint(const TQString &stationID);
+ TQString relHumidity(const TQString &stationID);
+ TQString heatIndex(const TQString &stationID);
+ TQString windChill(const TQString &stationID);
+ TQString wind(const TQString &stationID);
+ TQString pressure(const TQString &stationID);
+ TQString iconName(const TQString &stationID);
+ TQString date(const TQString &stationID);
+ TQStringList weather(const TQString &stationID);
+ TQString visibility(const TQString &stationID);
+ TQStringList cover(const TQString &stationID);
+ bool stationNeedsMaintenance(const TQString &stationID);
- QStringList stations();
- bool isNight(const QString &stationID) const;
+ TQStringList stations();
+ bool isNight(const TQString &stationID) const;
- void update(const QString &stationID);
- void forceUpdate(const QString &stationID);
- void remove(const QString &stationID);
+ void update(const TQString &stationID);
+ void forceUpdate(const TQString &stationID);
+ void remove(const TQString &stationID);
signals:
- void fileUpdating(const QString &stationID);
- void fileUpdate(const QString &stationID);
- void stationRemoved(const QString &stationID);
+ void fileUpdating(const TQString &stationID);
+ void fileUpdate(const TQString &stationID);
+ void stationRemoved(const TQString &stationID);
private slots:
void slotCopyDone(KIO::Job*);
private:
- Data* findData(const QString &stationID);
+ Data* findData(const TQString &stationID);
void clearData(Data *d);
void getData(Data *d, bool force = false);
- void processData(const QString &metar, Data *d);
+ void processData(const TQString &metar, Data *d);
StationDatabase *m_StationDb;
- QDict<Data> data;
+ TQDict<Data> data;
bool fileDownloaded;
bool hostDown;
};
diff --git a/kweather/weatherservice.cpp b/kweather/weatherservice.cpp
index c35ed8f..da179b6 100644
--- a/kweather/weatherservice.cpp
+++ b/kweather/weatherservice.cpp
@@ -31,25 +31,25 @@
#include "stationdatabase.h"
#include "sun.h"
-WeatherService::WeatherService(QObject *parent, const char *name) : QObject (parent, name), DCOPObject("WeatherService")
+WeatherService::WeatherService(TQObject *parent, const char *name) : TQObject (parent, name), DCOPObject("WeatherService")
{
kdDebug(12006) << "Starting new service... " << endl;
stationDB = new StationDatabase();
m_weatherLib = new WeatherLib(stationDB, this, "WeatherLib");
- connect(m_weatherLib, SIGNAL(fileUpdating( const QString&)),
- SLOT(updating( const QString&)));
- connect(m_weatherLib, SIGNAL(fileUpdate( const QString&)),
- SLOT(updated( const QString&)));
- connect(m_weatherLib, SIGNAL(stationRemoved(const QString&)),
- SLOT(slotStationRemoved(const QString&)));
+ connect(m_weatherLib, TQT_SIGNAL(fileUpdating( const TQString&)),
+ TQT_SLOT(updating( const TQString&)));
+ connect(m_weatherLib, TQT_SIGNAL(fileUpdate( const TQString&)),
+ TQT_SLOT(updated( const TQString&)));
+ connect(m_weatherLib, TQT_SIGNAL(stationRemoved(const TQString&)),
+ TQT_SLOT(slotStationRemoved(const TQString&)));
KConfig *conf = kapp->config();
conf->setGroup("WEATHERSTATIONS");
- QStringList stations =conf->readListEntry("stations");
- QStringList::Iterator it = stations.begin();
+ TQStringList stations =conf->readListEntry("stations");
+ TQStringList::Iterator it = stations.begin();
for ( ; it != stations.end(); ++it )
m_weatherLib->update(*it);
}
@@ -63,7 +63,7 @@ WeatherService::~WeatherService()
delete stationDB;
}
-void WeatherService::updated(const QString &stationID)
+void WeatherService::updated(const TQString &stationID)
{
kdDebug(12006) << "Sending update for " << stationID << endl;
emit fileUpdate( stationID );
@@ -72,129 +72,129 @@ void WeatherService::updated(const QString &stationID)
void WeatherService::updateAll()
{
kdDebug(12006) << "Sending for all" << endl;
- QStringList stations = m_weatherLib->stations();
- QStringList::ConstIterator end(stations.end());
- for ( QStringList::ConstIterator it = stations.begin(); it != end; ++it ) {
+ TQStringList stations = m_weatherLib->stations();
+ TQStringList::ConstIterator end(stations.end());
+ for ( TQStringList::ConstIterator it = stations.begin(); it != end; ++it ) {
update(*it);
}
}
-void WeatherService::updating(const QString &stationID)
+void WeatherService::updating(const TQString &stationID)
{
kdDebug(12006) << "Sending updating for " << stationID << endl;
emit fileUpdating( stationID );
}
-void WeatherService::slotStationRemoved(const QString &stationID)
+void WeatherService::slotStationRemoved(const TQString &stationID)
{
kdDebug(12006) << "Sending stationRemoved for " << stationID << endl;
emit stationRemoved( stationID );
}
-QString WeatherService::temperature(const QString &stationID)
+TQString WeatherService::temperature(const TQString &stationID)
{
kdDebug (12006) << "Returning " << stationID << endl;
return m_weatherLib->temperature(stationID);
}
-QString WeatherService::dewPoint(const QString &stationID)
+TQString WeatherService::dewPoint(const TQString &stationID)
{
return m_weatherLib->dewPoint(stationID);
}
-QString WeatherService::relativeHumidity(const QString &stationID)
+TQString WeatherService::relativeHumidity(const TQString &stationID)
{
return m_weatherLib->relHumidity(stationID);
}
-QString WeatherService::heatIndex(const QString &stationID)
+TQString WeatherService::heatIndex(const TQString &stationID)
{
return m_weatherLib->heatIndex(stationID);
}
-QString WeatherService::windChill(const QString &stationID)
+TQString WeatherService::windChill(const TQString &stationID)
{
return m_weatherLib->windChill(stationID);
}
-QString WeatherService::wind(const QString &stationID)
+TQString WeatherService::wind(const TQString &stationID)
{
return m_weatherLib->wind(stationID);
}
-QString WeatherService::pressure(const QString &stationID)
+TQString WeatherService::pressure(const TQString &stationID)
{
return m_weatherLib->pressure(stationID);
}
-QPixmap WeatherService::currentIcon(const QString &stationID)
+TQPixmap WeatherService::currentIcon(const TQString &stationID)
{
return icon( stationID );
}
-QPixmap WeatherService::icon(const QString &stationID)
+TQPixmap WeatherService::icon(const TQString &stationID)
{
kdDebug(12006) << "Get the current weather icon.." << endl;
- QString icon = iconFileName(stationID);
- QPixmap theIcon = QPixmap(icon);
+ TQString icon = iconFileName(stationID);
+ TQPixmap theIcon = TQPixmap(icon);
return theIcon;
}
-QString WeatherService::currentIconString(const QString &stationID)
+TQString WeatherService::currentIconString(const TQString &stationID)
{
return m_weatherLib->iconName(stationID);
}
-QString WeatherService::iconFileName(const QString &stationID)
+TQString WeatherService::iconFileName(const TQString &stationID)
{
- QString icon = m_weatherLib->iconName(stationID);
+ TQString icon = m_weatherLib->iconName(stationID);
icon = locate( "data", "kweather/" + icon + ".png" );
return icon;
}
-QString WeatherService::date(const QString &stationID)
+TQString WeatherService::date(const TQString &stationID)
{
return m_weatherLib->date(stationID);
}
-QString WeatherService::visibility(const QString &stationID)
+TQString WeatherService::visibility(const TQString &stationID)
{
return m_weatherLib->visibility(stationID);
}
-QStringList WeatherService::cover(const QString &stationID)
+TQStringList WeatherService::cover(const TQString &stationID)
{
return m_weatherLib->cover(stationID);
}
-QStringList WeatherService::weather(const QString &stationID)
+TQStringList WeatherService::weather(const TQString &stationID)
{
return m_weatherLib->weather(stationID);
}
-bool WeatherService::stationNeedsMaintenance(const QString &stationID)
+bool WeatherService::stationNeedsMaintenance(const TQString &stationID)
{
return m_weatherLib->stationNeedsMaintenance(stationID);
}
-void WeatherService::update(const QString &stationID)
+void WeatherService::update(const TQString &stationID)
{
m_weatherLib->update(stationID);
}
-void WeatherService::forceUpdate(const QString &stationID)
+void WeatherService::forceUpdate(const TQString &stationID)
{
m_weatherLib->forceUpdate(stationID);
}
-void WeatherService::removeStation(const QString &stationID)
+void WeatherService::removeStation(const TQString &stationID)
{
m_weatherLib->remove(stationID);
saveSettings();
}
-void WeatherService::addStation(const QString &stationID)
+void WeatherService::addStation(const TQString &stationID)
{
m_weatherLib->update(stationID);
saveSettings();
@@ -206,7 +206,7 @@ void WeatherService::exit()
kapp->quit();
}
-QStringList WeatherService::listStations()
+TQStringList WeatherService::listStations()
{
return m_weatherLib->stations();
}
@@ -219,17 +219,17 @@ void WeatherService::saveSettings()
conf->sync();
}
-QString WeatherService::stationName(const QString &stationID)
+TQString WeatherService::stationName(const TQString &stationID)
{
if ( stationDB )
{
- QString upperStationID = stationID.upper();
+ TQString upperStationID = stationID.upper();
return stationDB->stationNameFromID(upperStationID);
}
else
return stationID;
}
-QString WeatherService::stationCode( const QString &stationName )
+TQString WeatherService::stationCode( const TQString &stationName )
{
if ( stationDB )
{
@@ -239,51 +239,51 @@ QString WeatherService::stationCode( const QString &stationName )
return stationName;
}
-QString WeatherService::stationCountry(const QString &stationID)
+TQString WeatherService::stationCountry(const TQString &stationID)
{
if ( stationDB )
{
- QString upperStationID = stationID.upper();
+ TQString upperStationID = stationID.upper();
return stationDB->stationCountryFromID(upperStationID);
}
else
return stationID;
}
-QString WeatherService::longitude(const QString &stationID)
+TQString WeatherService::longitude(const TQString &stationID)
{
if ( stationDB )
{
- QString upperStationID = stationID.upper();
+ TQString upperStationID = stationID.upper();
return stationDB->stationLongitudeFromID(upperStationID);
}
else
return "None";
}
-QString WeatherService::latitude(const QString &stationID)
+TQString WeatherService::latitude(const TQString &stationID)
{
if ( stationDB )
{
- QString upperStationID = stationID.upper();
+ TQString upperStationID = stationID.upper();
return stationDB->stationLatitudeFromID(upperStationID);
}
else
return "None";
}
-QStringList WeatherService::findStations(float /*lon*/, float /*lat*/)
+TQStringList WeatherService::findStations(float /*lon*/, float /*lat*/)
{
- QStringList stationList;
+ TQStringList stationList;
stationList << "KMKE" << "KPNE" << "KTPW";
return stationList;
}
-QString WeatherService::getTime(const QString &stationID, TimeType timeType)
+TQString WeatherService::getTime(const TQString &stationID, TimeType timeType)
{
- QString upperStationID = stationID.upper();
+ TQString upperStationID = stationID.upper();
- QString latitude = stationDB->stationLatitudeFromID(upperStationID);
- QString longitude = stationDB->stationLongitudeFromID(upperStationID);
+ TQString latitude = stationDB->stationLatitudeFromID(upperStationID);
+ TQString longitude = stationDB->stationLongitudeFromID(upperStationID);
if ( latitude.compare( i18n("Unknown Station" ) ) == 0 ||
longitude.compare( i18n("Unknown Station" ) ) == 0 )
@@ -294,7 +294,7 @@ QString WeatherService::getTime(const QString &stationID, TimeType timeType)
{
Sun theSun( latitude, longitude );
- QTime time;
+ TQTime time;
switch ( timeType )
{
case RISE:
@@ -318,22 +318,22 @@ QString WeatherService::getTime(const QString &stationID, TimeType timeType)
}
}
-QString WeatherService::sunRiseTime(const QString &stationID)
+TQString WeatherService::sunRiseTime(const TQString &stationID)
{
return getTime(stationID, RISE);
}
-QString WeatherService::sunSetTime(const QString &stationID)
+TQString WeatherService::sunSetTime(const TQString &stationID)
{
return getTime(stationID, SET);
}
-QString WeatherService::civilTwilightStart(const QString &stationID)
+TQString WeatherService::civilTwilightStart(const TQString &stationID)
{
return getTime(stationID, CIVIL_START);
}
-QString WeatherService::civilTwilightEnd(const QString &stationID)
+TQString WeatherService::civilTwilightEnd(const TQString &stationID)
{
return getTime(stationID, CIVIL_END);
}
diff --git a/kweather/weatherservice.h b/kweather/weatherservice.h
index 1f3c781..6266087 100644
--- a/kweather/weatherservice.h
+++ b/kweather/weatherservice.h
@@ -22,14 +22,14 @@
#ifndef _WEATHER_SERVICE
#define _WEATHER_SERVICE
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <dcopobject.h>
-#include <qpixmap.h>
+#include <tqpixmap.h>
class WeatherLib;
class StationDatabase;
-class WeatherService : public QObject, public DCOPObject
+class WeatherService : public TQObject, public DCOPObject
{
Q_OBJECT
K_DCOP
@@ -38,56 +38,56 @@ class WeatherService : public QObject, public DCOPObject
WeatherLib *m_weatherLib;
private slots:
- void updated(const QString &stationID);
- void updating(const QString &stationID);
- void slotStationRemoved(const QString &stationID);
+ void updated(const TQString &stationID);
+ void updating(const TQString &stationID);
+ void slotStationRemoved(const TQString &stationID);
public:
- WeatherService(QObject *parent, const char *name);
+ WeatherService(TQObject *parent, const char *name);
~WeatherService();
k_dcop_signals:
- void fileUpdating(QString);
- void fileUpdate(QString);
- void stationRemoved(QString);
+ void fileUpdating(TQString);
+ void fileUpdate(TQString);
+ void stationRemoved(TQString);
k_dcop:
- QString temperature(const QString &stationID);
- QString dewPoint(const QString &stationID);
- QString relativeHumidity(const QString &stationID);
- QString heatIndex(const QString &stationID);
- QString windChill(const QString &stationID);
- QString wind(const QString &stationID);
- QString pressure(const QString &stationID);
- QPixmap currentIcon(const QString &stationID);
- QPixmap icon(const QString &stationID);
- QString currentIconString(const QString &stationID);
- QString iconFileName(const QString &stationID);
- QString date(const QString &stationID);
- QString visibility(const QString &stationID);
- QStringList cover(const QString &stationID);
- QStringList weather(const QString &stationID);
- bool stationNeedsMaintenance(const QString &stationID);
-
- QString stationName(const QString &stationID);
- QString stationCountry(const QString &stationID);
- QString longitude(const QString &stationID);
- QString latitude(const QString &stationID);
-
- QStringList findStations(float lon, float lat);
-
- QString sunRiseTime(const QString &stationID);
- QString sunSetTime(const QString &stationID);
- QString civilTwilightStart(const QString &stationID);
- QString civilTwilightEnd(const QString &stationID);
-
- void update(const QString &stationID);
+ TQString temperature(const TQString &stationID);
+ TQString dewPoint(const TQString &stationID);
+ TQString relativeHumidity(const TQString &stationID);
+ TQString heatIndex(const TQString &stationID);
+ TQString windChill(const TQString &stationID);
+ TQString wind(const TQString &stationID);
+ TQString pressure(const TQString &stationID);
+ TQPixmap currentIcon(const TQString &stationID);
+ TQPixmap icon(const TQString &stationID);
+ TQString currentIconString(const TQString &stationID);
+ TQString iconFileName(const TQString &stationID);
+ TQString date(const TQString &stationID);
+ TQString visibility(const TQString &stationID);
+ TQStringList cover(const TQString &stationID);
+ TQStringList weather(const TQString &stationID);
+ bool stationNeedsMaintenance(const TQString &stationID);
+
+ TQString stationName(const TQString &stationID);
+ TQString stationCountry(const TQString &stationID);
+ TQString longitude(const TQString &stationID);
+ TQString latitude(const TQString &stationID);
+
+ TQStringList findStations(float lon, float lat);
+
+ TQString sunRiseTime(const TQString &stationID);
+ TQString sunSetTime(const TQString &stationID);
+ TQString civilTwilightStart(const TQString &stationID);
+ TQString civilTwilightEnd(const TQString &stationID);
+
+ void update(const TQString &stationID);
void updateAll();
- void forceUpdate(const QString &stationID);
- void removeStation(const QString &stationID);
- void addStation(const QString &stationID);
- QStringList listStations();
- QString stationCode( const QString &stationName );
+ void forceUpdate(const TQString &stationID);
+ void removeStation(const TQString &stationID);
+ void addStation(const TQString &stationID);
+ TQStringList listStations();
+ TQString stationCode( const TQString &stationName );
void exit();
@@ -101,7 +101,7 @@ class WeatherService : public QObject, public DCOPObject
};
void saveSettings();
- QString getTime(const QString &stationID, TimeType timeType);
+ TQString getTime(const TQString &stationID, TimeType timeType);
StationDatabase *stationDB;
};
#endif