Commit 8ef610fb authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[applets/comic] Disable most context menu actions when comic is not ready

This can be either because the loading failed or is not done yet

In those cases the actions don't make sense and can lead to crashes

BUG: 406991
(cherry picked from commit 6a0aec81)
parent 3854385a
Pipeline #207111 failed with stage
in 3 minutes and 6 seconds
......@@ -496,6 +496,9 @@ void ComicApplet::updateContextMenu()
{
if (mCurrent.id().isEmpty()) {
mActiveComicModel->clear();
}
if (mCurrent.id().isEmpty() || !mCurrent.ready()) {
mActionNextNewStripTab->setEnabled(false);
mActionGoFirst->setEnabled(false);
mActionGoLast->setEnabled(false);
......
......@@ -61,6 +61,7 @@ void ComicData::setData(const ComicMetaData &data)
mPrev = data.previousIdentifier;
mNext = data.nextIdentifier;
mAdditionalText = data.additionalText;
mReady = true;
}
mWebsiteUrl = data.websiteUrl;
......
......@@ -191,6 +191,11 @@ public:
return mMaxStripNum;
}
bool ready() const
{
return mReady;
}
void save();
private:
......@@ -227,6 +232,7 @@ private:
bool mScaleComic = false;
bool mIsLeftToRight = false;
bool mIsTopToBottom = false;
bool mReady = false;
KConfigGroup mCfg;
};
......
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