[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdetoys/kweather
From:       Benoit Minisini <gambas () users ! sourceforge ! net>
Date:       2008-07-28 12:00:45
Message-ID: 1217246445.660443.24954.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 838649 by bminisini:

kweather: Fix source code indentation


 M  +95 -95    kweather.cpp  
 M  +42 -42    kweather.h  


--- branches/KDE/3.5/kdetoys/kweather/kweather.cpp #838648:838649
@@ -55,27 +55,27 @@
         mFirstRun( false ), mReport( 0 ), mClient( 0 ),
         mContextMenu( 0 ), mWeatherService( 0 ), settingsDialog( 0 ), \
mTextColor(Qt::black)  {
-	kdDebug(12004) << "Constructor " << endl;
-	setObjId("weatherIface");
-
-	setBackgroundOrigin( QWidget::AncestorOrigin );
-	loadPrefs();
-	initContextMenu();
-	initDCOP();
-
-	dockWidget = new dockwidget(reportLocation, this, "dockwidget");
-	connect(dockWidget, SIGNAL(buttonClicked()), SLOT(doReport()));
-	dockWidget->setViewMode(mViewMode);
-	setLabelColor();
-
-	timeOut = new QTimer(this, "timeOut" );
-	connect(timeOut, SIGNAL(timeout()), SLOT(timeout()));
-	timeOut->start(10*60*1000);
-
-	if(mFirstRun)
-		preferences();
-	else
-		timeout();
+    kdDebug(12004) << "Constructor " << endl;
+    setObjId("weatherIface");
+    
+    setBackgroundOrigin( QWidget::AncestorOrigin );
+    loadPrefs();
+    initContextMenu();
+    initDCOP();
+    
+    dockWidget = new dockwidget(reportLocation, this, "dockwidget");
+    connect(dockWidget, SIGNAL(buttonClicked()), SLOT(doReport()));
+    dockWidget->setViewMode(mViewMode);
+    setLabelColor();
+    
+    timeOut = new QTimer(this, "timeOut" );
+    connect(timeOut, SIGNAL(timeout()), SLOT(timeout()));
+    timeOut->start(10*60*1000);
+    
+    if(mFirstRun)
+        preferences();
+    else
+        timeout();
 }
 
 kweather::~kweather()
@@ -100,27 +100,27 @@
 
 void kweather::initDCOP()
 {
-	if ( !mClient )
-		mClient = KApplication::dcopClient();
-
-	if(!mClient->isAttached())
-		mClient->attach();
-
-	if(!attach())
-		return;
-
-	kdDebug(12004) << "attached to the server..." << endl;
-
-	if ( mWeatherService )
-		delete mWeatherService;
-
-	mWeatherService = new WeatherService_stub( "KWeatherService", "WeatherService" );
-
-	if (!connectDCOPSignal(0, 0, "fileUpdate(QString)",
-		"refresh(QString)",false))
-		kdDebug(12004) << "Could not attach dcop signal..." << endl;
-	else
-		kdDebug(12004) << "attached dcop signals..." << endl;
+    if ( !mClient )
+        mClient = KApplication::dcopClient();
+    
+    if(!mClient->isAttached())
+        mClient->attach();
+    
+    if(!attach())
+        return;
+    
+    kdDebug(12004) << "attached to the server..." << endl;
+    
+    if ( mWeatherService )
+        delete mWeatherService;
+    
+    mWeatherService = new WeatherService_stub( "KWeatherService", "WeatherService" \
); +    
+    if (!connectDCOPSignal(0, 0, "fileUpdate(QString)",
+        "refresh(QString)",false))
+        kdDebug(12004) << "Could not attach dcop signal..." << endl;
+    else
+        kdDebug(12004) << "attached dcop signals..." << endl;
 }
 
 /** about box */
@@ -184,21 +184,21 @@
         return;
     }
 
-	kdDebug(12004) << "Showing out the report" << endl;
-	if ( mReport == 0 )
-	{
-		mReport = new reportView(reportLocation);
-
-		connect( mReport, SIGNAL( finished() ), SLOT( slotReportFinished() ) );
-	}
-
-	mReport->show();
-	mReport->raise();
+    kdDebug(12004) << "Showing out the report" << endl;
+    if ( mReport == 0 )
+    {
+        mReport = new reportView(reportLocation);
+    
+        connect( mReport, SIGNAL( finished() ), SLOT( slotReportFinished() ) );
+    }
+    
+    mReport->show();
+    mReport->raise();
 }
 
 void kweather::slotReportFinished(){
-	mReport->delayedDestruct();
-	mReport = 0;
+    mReport->delayedDestruct();
+    mReport = 0;
 }
 
 /** load the application */
@@ -222,15 +222,15 @@
 
 /** Save the application mPrefs. */
 void kweather::savePrefs(){
-	kdDebug(12004) << "Saving Prefs..." << endl;
-	KConfig *kcConfig = config();
-
-	kcConfig->setGroup("General Options");
-	kcConfig->writeEntry("logging", logOn);
-	kcConfig->writeEntry("report_location", reportLocation);
-	kcConfig->writeEntry("smallview_mode", mViewMode);
-	kcConfig->writePathEntry("log_file_name", fileName );
-	kcConfig->sync();
+    kdDebug(12004) << "Saving Prefs..." << endl;
+    KConfig *kcConfig = config();
+    
+    kcConfig->setGroup("General Options");
+    kcConfig->writeEntry("logging", logOn);
+    kcConfig->writeEntry("report_location", reportLocation);
+    kcConfig->writeEntry("smallview_mode", mViewMode);
+    kcConfig->writePathEntry("log_file_name", fileName );
+    kcConfig->sync();
 }
 
 void kweather::showWeather()
@@ -280,46 +280,46 @@
 }
 
 /** get new data */
-void kweather::timeout(){
-
-	if ( !mWeatherService )
-		initDCOP();
-
-	if ( mWeatherService )
-	{
-		// isEmtpy is true for null and 0 length strings
-		if ( !reportLocation.isEmpty() )
-		{
-			kdDebug(12004)<< "Requesting new data for " << reportLocation << endl;
-			mWeatherService->update(reportLocation);
-		}
-	}
+void kweather::timeout()
+{
+    if ( !mWeatherService )
+        initDCOP();
+    
+    if ( mWeatherService )
+    {
+        // isEmtpy is true for null and 0 length strings
+        if ( !reportLocation.isEmpty() )
+        {
+        kdDebug(12004)<< "Requesting new data for " << reportLocation << endl;
+        mWeatherService->update(reportLocation);
+        }
+    }
 }
 
 int kweather::widthForHeight(int h) const
 {
-	//kdDebug(12004) << "widthForHeight " << h << endl;
-	dockWidget->setOrientation(Horizontal);
-	int w = dockWidget->widthForHeight(h);
-	return w;
+    //kdDebug(12004) << "widthForHeight " << h << endl;
+    dockWidget->setOrientation(Horizontal);
+    int w = dockWidget->widthForHeight(h);
+    return w;
 }
 
 int kweather::heightForWidth(int w) const
 {
-	kdDebug(12004) << "heightForWidth " << w<< endl;
-	dockWidget->setOrientation(Vertical);
-	int h = dockWidget->heightForWidth( w );
-	return h;
+    kdDebug(12004) << "heightForWidth " << w<< endl;
+    dockWidget->setOrientation(Vertical);
+    int h = dockWidget->heightForWidth( w );
+    return h;
 }
 
 void kweather::refresh(QString stationID)
 {
-	kdDebug(12004) << "refresh " << stationID << endl;
-	if( stationID == reportLocation)
-	{
-		showWeather();
-		writeLogEntry();
-	}
+    kdDebug(12004) << "refresh " << stationID << endl;
+    if( stationID == reportLocation)
+    {
+        showWeather();
+        writeLogEntry();
+    }
 }
 
 void kweather::slotPrefsAccepted()
@@ -408,18 +408,18 @@
 
 void kweather::resizeEvent(QResizeEvent *e)
 {
-	kdDebug(12004) << "KWeather Resize event " << e->size() << endl;
-	dockWidget->resizeView(e->size());
+    kdDebug(12004) << "KWeather Resize event " << e->size() << endl;
+    dockWidget->resizeView(e->size());
 }
 
 void kweather::setLabelColor()
 {
-	setPaletteForegroundColor(mTextColor);
+    setPaletteForegroundColor(mTextColor);
 }
 
 void kweather::paletteChange(const QPalette &)
 {
-	setLabelColor();
+    setLabelColor();
 }
 
 #include "kweather.moc"
--- branches/KDE/3.5/kdetoys/kweather/kweather.h #838648:838649
@@ -35,56 +35,56 @@
     Q_OBJECT
 
 public:
-	kweather(const QString& configFile, Type t = Normal, int actions = 0, QWidget \
                *parent = 0, const char *name = 0);
-	~kweather();
-	void help();
-	void resizeEvent(QResizeEvent*);
-	int heightForWidth(int i) const;
-	int widthForHeight(int i) const;
-	void refresh(QString);
-	void setBackground();
-	void setLabelColor();
+    kweather(const QString& configFile, Type t = Normal, int actions = 0, QWidget \
*parent = 0, const char *name = 0); +    ~kweather();
+    void help();
+    void resizeEvent(QResizeEvent*);
+    int heightForWidth(int i) const;
+    int widthForHeight(int i) const;
+    void refresh(QString);
+    void setBackground();
+    void setLabelColor();
 
 public slots: // Public slots
-	void preferences();
-	void about();
+    void preferences();
+    void about();
 
 protected:
-	void paletteChange(const QPalette &);
+    void paletteChange(const QPalette &);
 
 protected slots:
-	void doReport();
-	void timeout();
-	void slotPrefsAccepted();
-	void slotReportFinished();
-	void slotUpdateNow();
+    void doReport();
+    void timeout();
+    void slotPrefsAccepted();
+    void slotReportFinished();
+    void slotUpdateNow();
 
 private: // Private methods
-	void initContextMenu();
-	void initDCOP();
-	void loadPrefs();
-	void savePrefs();
-	void showWeather();
-	void writeLogEntry();
-	void mousePressEvent(QMouseEvent *e);
-
-	bool attach();
-
-	QString reportLocation;
-	QString fileName;
-	QString metarData;
-	bool logOn;
-	bool mFirstRun;
-	int mViewMode;
-	QTimer *timeOut;
-	dockwidget *dockWidget;
-	reportView *mReport;
-	DCOPClient *mClient;
-	//DCOPRef *mWeatherService;
-	KPopupMenu *mContextMenu;
-	WeatherService_stub *mWeatherService;
-	KCMultiDialog *settingsDialog;
-	QColor mTextColor;
+    void initContextMenu();
+    void initDCOP();
+    void loadPrefs();
+    void savePrefs();
+    void showWeather();
+    void writeLogEntry();
+    void mousePressEvent(QMouseEvent *e);
+    
+    bool attach();
+    
+    QString reportLocation;
+    QString fileName;
+    QString metarData;
+    bool logOn;
+    bool mFirstRun;
+    int mViewMode;
+    QTimer *timeOut;
+    dockwidget *dockWidget;
+    reportView *mReport;
+    DCOPClient *mClient;
+    //DCOPRef *mWeatherService;
+    KPopupMenu *mContextMenu;
+    WeatherService_stub *mWeatherService;
+    KCMultiDialog *settingsDialog;
+    QColor mTextColor;
 };
 
 #endif


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic