SVN commit 761976 by weilbach: Cleanup... M +1 -1 backend.cpp M +12 -20 backendjobs.cpp M +1 -0 backendjobsqueue.cpp M +1 -1 composer.cpp M +2 -1 kbloggerblog.h --- trunk/playground/pim/kblogger/src/backend.cpp #761975:761976 @@ -54,8 +54,8 @@ Backend::Backend( QObject* parent): QObject(parent) { + kDebug(); mKblogger = qobject_cast (parent); - //Q_ASSERT(mKblogger); } void Backend::initialize() --- trunk/playground/pim/kblogger/src/backendjobs.cpp #761975:761976 @@ -41,7 +41,7 @@ #include "kbloggermedia.h" #define APPLICATION_NAME "KBlogger" -#define APPLICATION_VER "0.8-wip" +#define APPLICATION_VER "1.0-alpha2" Q_DECLARE_METATYPE(KBlogger::KBloggerPost*); Q_DECLARE_METATYPE(KBlog::BlogMedia*); @@ -249,44 +249,36 @@ break; case FETCH_CATEGORIES: { //METAWEBLOG - KBlog::MetaWeblog *MWBlog = qobject_cast(mKBlog); - connect(MWBlog, SIGNAL( listedCategories( const QList >& )), + KBlog::MetaWeblog* mMetaWeblog = dynamic_cast(mKBlog); + connect(mMetaWeblog, SIGNAL( listedCategories( const QList >& )), this, SLOT( slotListedCategories( const QList >& ) )); - kDebug() << "Running " << MWBlog << "->listCategories" << endl; + kDebug() << "Running " << mMetaWeblog << "->listCategories" << endl; - MWBlog->listCategories(); + mMetaWeblog->listCategories(); } break; case CREATE_MEDIA: { //METAWEBLOG + KBlog::MetaWeblog* mMetaWeblog = dynamic_cast(mKBlog); KBlog::BlogMedia *media; - KBlog::MetaWeblog *MWBlog = qobject_cast(mKBlog); // FIXME not possible for GDATA media = mArg.value(); + if (!media) { kError() << "media is NULL" << endl; return; } - if(!MWBlog) { // FIXME do not crash on GDATA for the moment - kError() << "MWBlog is NULL: casting has not worked, this should NEVER happen, has the gui allowed using GDATA?" << endl; - return; - } - connect(MWBlog, SIGNAL( createdMedia( KBlog::BlogMedia* ) ), + + connect(mMetaWeblog, SIGNAL( createdMedia( KBlog::BlogMedia* ) ), this, SLOT( slotCreatedMedia( KBlog::BlogMedia* ) )); - kDebug() << "Running " << MWBlog << "->createMedia" << endl; + kDebug() << "Running " << mMetaWeblog << "->createMedia" << endl; - MWBlog->createMedia(media); + mMetaWeblog->createMedia(media); } break; } - // TODO why do it again? remove if there are no issues, otherwise fix it... -// createBackend(&mKBlogInfo); - if (!mKBlog) { - kError() << "mKBlog is NULL" << endl; - return; - } - + if (!mKBlog) kError() << "mKBlog is NULL" << endl; } const QString& BackendJobs::getWaitMessage() --- trunk/playground/pim/kblogger/src/backendjobsqueue.cpp #761975:761976 @@ -174,6 +174,7 @@ // show the wait dialog with the progress bar WaitDialog::self()->setText( currentJob->getWaitMessage() ); + WaitDialog::self()->setParent( currentJob->getWidgetParent() ); WaitDialog::self()->show(); connect(currentJob, SIGNAL( result( KJob * ) ), --- trunk/playground/pim/kblogger/src/composer.cpp #761975:761976 @@ -123,7 +123,7 @@ mBlogChooser = new BlogChooser( blogGroupBox ); blogGroupBox->layout()->addWidget( mBlogChooser ); - //Add Editor: NOTE Editor require BlogChooser! + //Add Editor: NOTE Editor requires BlogChooser! mEditor = new ComposerEditor(this, editorFrame); editorFrame->layout()->addWidget(mEditor); --- trunk/playground/pim/kblogger/src/kbloggerblog.h #761975:761976 @@ -23,6 +23,7 @@ #define KBLOGGER_BLOG_H #include + #include "backend.h" class KIcon; @@ -39,7 +40,7 @@ { public: - KBloggerBlog( ); + KBloggerBlog(); ~KBloggerBlog();