summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/packagewin.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/aqpkg/packagewin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/packagewin.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/settings/aqpkg/packagewin.cpp b/noncore/settings/aqpkg/packagewin.cpp
index 9553cd1..499d647 100644
--- a/noncore/settings/aqpkg/packagewin.cpp
+++ b/noncore/settings/aqpkg/packagewin.cpp
@@ -23,91 +23,92 @@
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "packagewin.h"
#include "package.h"
#include "datamgr.h"
#include <qpe/resource.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include <qstring.h>
#include <qtextview.h>
PackageWindow::PackageWindow( Package *package, const QString &server )
: QWidget( 0, 0, 0 )
{
QString str;
if ( package )
{
+ Package *local = package->getLocalPackage();
setCaption( package->getPackageName() );
QString destName;
- if ( package->getLocalPackage() )
+ if ( local )
{
- if ( package->getLocalPackage()->getInstalledTo() )
+ if ( local->getInstalledTo() )
destName = package->getLocalPackage()->getInstalledTo()->getDestinationName();
}
else
{
if ( package->getInstalledTo() )
destName = package->getInstalledTo()->getDestinationName();
}
if ( !package->isPackageStoredLocally() )
{
str.append( tr( "<b>Description</b> - " ) );
str.append( package->getDescription() );
if ( !destName.isNull() )
{
str.append( tr( "<p><b>Installed To</b> - " ) );
str.append( destName );
}
str.append( tr( "<p><b>Size</b> - " ) );
str.append( package->getPackageSize() );
str.append( tr( "<p><b>Section</b> - " ) );
str.append( package->getSection() );
}
else
{
str.append( tr( "<p><b>Filename</b> - " ) );
str.append( package->getFilename() );
}
if ( server == LOCAL_SERVER )
{
str.append( tr( "<p><b>Version Installed</b> - " ) );
str.append( package->getVersion() );
}
else
{
str.append( tr( "<p><b>Version Available</b> - " ) );
str.append( package->getVersion() );
- if ( package->getLocalPackage() )
+ if ( local )
{
if ( package->isInstalled() )
{
str.append( tr( "<p><b>Version Installed</b> - " ) );
str.append( package->getInstalledVersion() );
}
}
}
}
else
{
setCaption( tr( "Package Information" ) );
str = tr( "Package information is unavailable" );
}
QVBoxLayout *layout = new QVBoxLayout( this, 4, 4 );
QTextView *l = new QTextView( str, QString::null, this );
layout->addWidget( l );
QPushButton *btn = new QPushButton( Resource::loadPixmap( "enter" ), tr( "Close" ), this );
layout->addWidget( btn );
connect( btn, SIGNAL( clicked() ), this, SLOT( close() ) );