Commit 5c2a5852 authored by Teo Mrnjavac's avatar Teo Mrnjavac
Browse files

Fixed bug with the LikeBack reappearing even if disabled.

Even if the LikeBack icons in the top right of every window were
disabled, they used to reappear after reporting an issue because of poor
logic with a signal/slot connection.
BUG: 248031
FIXED-IN: 2.4.2
CCMAIL: apachelogger@ubuntu.com
parent c3ad9abd
......@@ -60,7 +60,7 @@ LikeBack::LikeBack( Button buttons, bool showBarByDefault, KConfig *config, cons
d->showBarByDefault = showBarByDefault;
// Initialize properties (2/2) [Needs aboutData to be set]:
d->showBar = userWantsToShowBar();
d->showBar = d->config.readEntry( "userWantToShowBar", d->showBarByDefault );
// Initialize the button-bar:
d->bar = new LikeBackBar( this );
......@@ -161,7 +161,10 @@ void LikeBack::enableBar()
#endif
if( d->bar )
d->bar->setBarVisible( d->disabledCount <= 0 );
d->bar->setBarVisible( d->disabledCount <= 0 && userWantsToShowBar() );
#ifdef DEBUG_LIKEBACK
debug() << "User wants to show feedback bar: " << userWantsToShowBar() << " " << d->disabledCount;
#endif
}
......@@ -176,11 +179,8 @@ bool LikeBack::enabledBar()
void LikeBack::execCommentDialog( Button type, const QString &initialComment, const QString &windowPath, const QString &context )
{
LikeBackDialog *dialog = new LikeBackDialog( type, initialComment, windowPath, context, this );
if( userWantsToShowBar() )
{
disableBar();
connect( dialog, SIGNAL( destroyed( QObject* ) ), this, SLOT( enableBar() ) );
}
disableBar();
connect( dialog, SIGNAL( finished() ), this, SLOT( enableBar() ) );
dialog->show();
}
......@@ -241,7 +241,7 @@ bool LikeBack::userWantsToShowBar()
// it's very annoying to have the bar reappearing everytime.
// return d->config.readEntry( "userWantToShowBarForVersion_" + d->aboutData->version(), d->showBarByDefault );
return d->config.readEntry( "userWantToShowBar", d->showBarByDefault );
return d->showBar;
}
......
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