Commit 47cb0dec authored by Matthias Fuchs's avatar Matthias Fuchs
Browse files

Display tabs on startup even if the first tab was not loaded yet.

BUG:274845
parent 89811dc7
......@@ -241,6 +241,9 @@ void ComicApplet::init()
mActions.append( mActionStorePosition );
connect( mActionStorePosition, SIGNAL( triggered( bool ) ), this, SLOT( slotStorePosition() ) );
//make sure that tabs etc. are displayed even if the comic strip in the first tab does not work
updateView();
updateUsedComics();
changeComic( true );
}
......@@ -490,6 +493,23 @@ void ComicApplet::dataUpdated( const QString &source, const Plasma::DataEngine::
mEngine->disconnectSource( source, this );
}
//prefetch the previous and following comic for faster navigation
if ( !mNextIdentifierSuffix.isEmpty() ) {
const QString prefetch = mComicIdentifier + ':' + mNextIdentifierSuffix;
mEngine->connectSource( prefetch, this );
mEngine->query( prefetch );
}
if ( !mPreviousIdentifierSuffix.isEmpty() ) {
const QString prefetch = mComicIdentifier + ':' + mPreviousIdentifierSuffix;
mEngine->connectSource( prefetch, this );
mEngine->query( prefetch );
}
updateView();
}
void ComicApplet::updateView()
{
const bool tabsVisible = (mTabIdentifier.count() > 1);
setTabBarVisible( tabsVisible );
mLabelTop->setVisible( ( mShowComicAuthor || mShowComicTitle ) && !mLabelTop->text().isEmpty() );
......@@ -517,18 +537,6 @@ void ComicApplet::dataUpdated( const QString &source, const Plasma::DataEngine::
if ( !mImage.isNull() ) {
QTimer::singleShot( 1, this, SLOT( updateSize()) );//HACK
}
//prefetch the previous and following comic for faster navigation
if ( !mNextIdentifierSuffix.isEmpty() ) {
const QString prefetch = mComicIdentifier + ':' + mNextIdentifierSuffix;
mEngine->connectSource( prefetch, this );
mEngine->query( prefetch );
}
if ( !mPreviousIdentifierSuffix.isEmpty() ) {
const QString prefetch = mComicIdentifier + ':' + mPreviousIdentifierSuffix;
mEngine->connectSource( prefetch, this );
mEngine->query( prefetch );
}
}
void ComicApplet::createConfigurationInterface( KConfigDialog *parent )
......@@ -590,6 +598,9 @@ void ComicApplet::applyConfig()
saveConfig();
buttonBar();
//make sure that tabs etc. are displayed even if the comic strip in the first tab does not work
updateView();
changeComic( mDifferentComic );
}
......
......@@ -200,6 +200,7 @@ class ComicApplet : public Plasma::PopupApplet
void updateUsedComics();
void updateButtons();
void updateContextMenu();
void updateView();
void saveConfig();
bool isInPanel() const;
void setTabBarVisible( bool isVisible );//HACK what was in 4.4 does not seem to work anymore, so this was added
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment