Diffstat (limited to 'noncore/settings/packagemanager/packageinfodlg.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/packageinfodlg.cpp | 10 |
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 | ||
126 | void PackageInfoDlg::slotBtnFileScan() | 127 | void 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 | ||
137 | void PackageInfoDlg::slotInfo( char *info ) | 139 | void PackageInfoDlg::slotInfo( const QString &info ) |
138 | { | 140 | { |
139 | m_information.append( info ); | 141 | m_information.append( info ); |
140 | } | 142 | } |
141 | 143 | ||
142 | void PackageInfoDlg::slotFiles( char *filelist ) | 144 | void 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 | } |