summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/packageinfodlg.cpp
authordrw <drw>2005-01-02 20:26:01 (UTC)
committer drw <drw>2005-01-02 20:26:01 (UTC)
commite763e0cea060ae3a2dfb1c411f56354e27ac12a9 (patch) (unidiff)
tree37896734be7d2679c3f19635fe9fe3b52a549332 /noncore/settings/packagemanager/packageinfodlg.cpp
parent020ea2d54bcd0fc4420cb433b3e657cd13ae07e2 (diff)
downloadopie-e763e0cea060ae3a2dfb1c411f56354e27ac12a9.zip
opie-e763e0cea060ae3a2dfb1c411f56354e27ac12a9.tar.gz
opie-e763e0cea060ae3a2dfb1c411f56354e27ac12a9.tar.bz2
Implement native package linking code (removing need for ipkg-link and its shortcomings), move package linking code to OIpkg (proper place for ipkg specific code), many small code tweaks and bump version up to 0.6.1
Diffstat (limited to 'noncore/settings/packagemanager/packageinfodlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/packageinfodlg.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp
index 5f72a67..3eef939 100644
--- a/noncore/settings/packagemanager/packageinfodlg.cpp
+++ b/noncore/settings/packagemanager/packageinfodlg.cpp
@@ -67,25 +67,26 @@ PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QStr
67 { 67 {
68 m_information.setText( tr( "Unable to retrieve package information." ) ); 68 m_information.setText( tr( "Unable to retrieve package information." ) );
69 return; 69 return;
70 } 70 }
71 71
72 // Display package information 72 // Display package information
73 if ( !m_package->information().isNull() ) 73 if ( !m_package->information().isNull() )
74 m_information.setText( m_package->information() ); 74 m_information.setText( m_package->information() );
75 else 75 else
76 { 76 {
77 // Package information is not cached, retrieve it 77 // Package information is not cached, retrieve it
78 QStringList list( package ); 78 QStringList list( package );
79 m_packman->executeCommand( OPackage::Info, list, QString::null, this, SLOT(slotInfo(char*)), true ); 79 m_packman->executeCommand( OPackage::Info, list, QString::null,
80 this, SLOT(slotInfo(const QString &)), true );
80 } 81 }
81 82
82 // Files tab (display only if package is installed) 83 // Files tab (display only if package is installed)
83 if ( !m_package->versionInstalled().isNull() ) 84 if ( !m_package->versionInstalled().isNull() )
84 { 85 {
85 QWidget *filesWidget = new QWidget( tabWidget ); 86 QWidget *filesWidget = new QWidget( tabWidget );
86 QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 ); 87 QVBoxLayout *filesLayout = new QVBoxLayout( filesWidget, 2, 2 );
87 QWhatsThis::add( &m_files, tr( "This area contains a list of files contained in this package." ) ); 88 QWhatsThis::add( &m_files, tr( "This area contains a list of files contained in this package." ) );
88 m_files.reparent( filesWidget, QPoint( 0, 0 ) ); 89 m_files.reparent( filesWidget, QPoint( 0, 0 ) );
89 m_files.setReadOnly( true ); 90 m_files.setReadOnly( true );
90 filesLayout->addWidget( &m_files ); 91 filesLayout->addWidget( &m_files );
91 92
@@ -119,33 +120,34 @@ PackageInfoDlg::~PackageInfoDlg()
119 m_package->setInformation( m_information.text() ); 120 m_package->setInformation( m_information.text() );
120 121
121 // Cache package file list 122 // Cache package file list
122 if ( !m_files.text().isEmpty() ) 123 if ( !m_files.text().isEmpty() )
123 m_package->setFiles( m_files.text() ); 124 m_package->setFiles( m_files.text() );
124} 125}
125 126
126void PackageInfoDlg::slotBtnFileScan() 127void PackageInfoDlg::slotBtnFileScan()
127{ 128{
128 m_files.clear(); 129 m_files.clear();
129 130
130 QStringList list( m_package->name() ); 131 QStringList list( m_package->name() );
131 m_packman->executeCommand( OPackage::Files, list, QString::null, this, SLOT(slotFiles(char*)), true ); 132 m_packman->executeCommand( OPackage::Files, list, QString::null,
133 this, SLOT(slotFiles(const QString &)), true );
132 134
133 if ( m_retrieveFiles ) 135 if ( m_retrieveFiles )
134 m_retrieveFiles->hide(); 136 m_retrieveFiles->hide();
135} 137}
136 138
137void PackageInfoDlg::slotInfo( char *info ) 139void PackageInfoDlg::slotInfo( const QString &info )
138{ 140{
139 m_information.append( info ); 141 m_information.append( info );
140} 142}
141 143
142void PackageInfoDlg::slotFiles( char *filelist ) 144void PackageInfoDlg::slotFiles( const QString &filelist )
143{ 145{
144 QString str = filelist; 146 QString str = filelist;
145 147
146 // Skip first line of output ("Package xxx is installed...") 148 // Skip first line of output ("Package xxx is installed...")
147 if ( str.startsWith( "Package " ) ) 149 if ( str.startsWith( "Package " ) )
148 str = str.right( str.length() - str.find( '\n' ) - 1 ); 150 str = str.right( str.length() - str.find( '\n' ) - 1 );
149 151
150 m_files.append( str ); 152 m_files.append( str );
151} 153}