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

List:       kde-commits
Subject:    playground/pim/microblog
From:       Tom Albers <tomalbers () kde ! nl>
Date:       2009-02-19 20:04:41
Message-ID: 1235073881.704911.11740.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 928675 by toma:

Set the name properly and guard for checks when there is no connection yet.


 M  +13 -2     microblog.cpp  


--- trunk/playground/pim/microblog/microblog.cpp #928674:928675
@@ -55,6 +55,10 @@
 void MicroblogResource::initComm()
 {
     delete m_comm;
+    m_comm = 0;
+  
+    if ( Settings::self()->userName().isEmpty() || Settings::self()->password().isEmpty() )
+        return;
 
     m_comm = new Communication( this );
     m_comm->setService( 0 ); // Todo..
@@ -69,8 +73,15 @@
 {
     QHash<QString,Collection> collections;
 
+    // if there is no connection, don't continue.
+    if ( !m_comm ) {
+        kDebug() << "Tried to retrieve collection, but there is no connection";
+        collectionsRetrieved( collections.values() );
+        return;
+    }
+        
     Collection root;
-    root.setName( i18n( "Microblog" ) );
+    root.setName( i18n( "%1's microblog", Settings::self()->name() ) );
     root.setRemoteId( "microblog" );
     root.setContentMimeTypes( QStringList( Collection::mimeType() ) );
     Collection::Rights rights = Collection::ReadOnly;
@@ -176,7 +187,7 @@
         KWindowSystem::setMainWindow( &dlg, windowId );
     dlg.exec();
     if ( !Settings::self()->name().isEmpty() )
-        setName( Settings::self()->name() );
+        setName( i18n("%1's microblog", Settings::self()->name() ) );
     initComm();
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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