Permalink
Browse files

static variable removed and member variable used

  • Loading branch information...
saurabhsood91 committed Aug 7, 2012
1 parent 2dd5128 commit 2c2018000ba8b2366fc0f8e0ced146a3acc324d2
Showing with 7 additions and 5 deletions.
  1. +4 −4 src/repositorywidget.cpp
  2. +3 −1 src/repositorywidget.h
View
@@ -62,13 +62,13 @@ RepositoryWidget::RepositoryWidget(PackageBackend *backend, int index, OCI::Repo
if( m_settings.value( "showdetails", 1 ).toInt() == 1 ) {
showDetails( QString( "%1" ).arg( index ) );
}
+
+ m_visible = false;
}
void RepositoryWidget::showDetails( QString link )
{
- static int shownOnce = 0;
-
- if( shownOnce == 0 ) {
+ if( !m_visible ) {
m_meta = new RepositoryMetadata( m_repo );
m_meta->refresh();
m_id = new QLabel( QString( "<b>ID:</b> %1" ).arg( m_meta->id() ) );
@@ -79,7 +79,7 @@ void RepositoryWidget::showDetails( QString link )
m_fingerprint->setStyleSheet( "background-color: rgb(254, 250, 210); padding-left : 10px; padding-top : 10px; padding-bottom : 10px; border-right : 1px solid rgb(196,181,147); border-left : 1px solid rgb(196,181,147);" );
m_created->setStyleSheet( "background-color: rgb(254, 250, 210); padding-left : 10px; padding-top : 10px; padding-bottom : 10px; border-right : 1px solid rgb(196,181,147); border-left : 1px solid rgb(196,181,147);" );
m_expires->setStyleSheet( "background-color: rgb(254, 250, 210); padding-left : 10px; padding-top : 10px; padding-bottom : 10px; border-right : 1px solid rgb(196,181,147); border-left : 1px solid rgb(196,181,147);" );
- shownOnce++;
+ m_visible = true;
}
int linkNo = link.toInt();
View
@@ -30,10 +30,12 @@ private slots:
QLabel *m_summary;
QSettings m_settings;
- OCI::Repository *m_repo;
+ OCI::Repository *m_repo;
RepositoryMetadata *m_meta;
+ bool m_visible;
+
bool m_detailsVisible;
};

0 comments on commit 2c20180

Please sign in to comment.