diff options
Diffstat (limited to 'kdpkg-install')
-rw-r--r-- | kdpkg-install/install.cpp | 41 | ||||
-rw-r--r-- | kdpkg-install/install.h | 1 | ||||
-rw-r--r-- | kdpkg-install/main.cpp | 2 | ||||
-rwxr-xr-x | kdpkg-install/sh/kdpkg-sh | 2 |
4 files changed, 44 insertions, 2 deletions
diff --git a/kdpkg-install/install.cpp b/kdpkg-install/install.cpp index 9904018..7b26e58 100644 --- a/kdpkg-install/install.cpp +++ b/kdpkg-install/install.cpp @@ -200,6 +200,36 @@ void install::page4() } +//----------------------------------------------------------------------------// +//--- get --------------------------------------------------------------------// +//----------------------------------------------------------------------------// + +QStringList install::getVersions(QString package) +{ + this->shell->setCommand("apt-cache policy "+package); + this->shell->start(true); + QStringList input = QStringList::split( "\n", this->shell->getBuffer().stripWhiteSpace() ); + + QString sysVersion = input[1]; + sysVersion = QStringList::split( ":", sysVersion)[1].replace(" ",""); + + if( sysVersion.contains("(") || sysVersion == "" ) + sysVersion = i18n("not installed"); + + + QString repVersion = input[2]; + repVersion = QStringList::split( ":", repVersion)[1].replace(" ",""); + + if( repVersion.contains("(") || repVersion == "" ) + repVersion = i18n("not available"); + + + QStringList versions; + versions.append(sysVersion); + versions.append(repVersion); + + return versions; +} //----------------------------------------------------------------------------// //--- showDependencies -------------------------------------------------------// @@ -212,6 +242,17 @@ void install::showDependencies() // show packages which will be installed + QString debianPkgName = fields.grep("Package:")[0].mid(9); + QString debianPkgVersion = fields.grep("Version:")[0].mid(9); + QStringList debianVersions = getVersions(fields.grep("Package:")[0].mid(9)); + QString debianSysVersion = debianVersions[0]; + QListViewItem * ditem = new QListViewItem( dependenciesListView, 0 ); + ditem->setPixmap( 0, QPixmap( m_kdePrefix + "/share/kdpkg/icons/install.png") ); + ditem->setText( 1, debianPkgName ); + ditem->setText( 2, debianPkgVersion ); + ditem->setText( 3, debianSysVersion ); + + QString tmpString = fields.grep( QRegExp("^Depends:") )[0].mid(9); tmpString += ", "+fields.grep( "Pre-Depends:" )[0].mid(13); diff --git a/kdpkg-install/install.h b/kdpkg-install/install.h index dafb90d..3b896b1 100644 --- a/kdpkg-install/install.h +++ b/kdpkg-install/install.h @@ -41,6 +41,7 @@ class install : public InstallDialog bool isInstalled(QString); bool checkArchitecture(); bool isLocked(); + QStringList getVersions(QString); diff --git a/kdpkg-install/main.cpp b/kdpkg-install/main.cpp index e0eec81..8b69e81 100644 --- a/kdpkg-install/main.cpp +++ b/kdpkg-install/main.cpp @@ -45,7 +45,7 @@ int main(int argc, char **argv) about->setLicense(KAboutData::License_GPL_V2); about->setHomepage("http://trinity.pearsoncomputing.net"); about->setBugAddress("http://bugs.pearsoncomputing.net"); - about->setCopyrightStatement("(c) 2010 Timothy Pearson\r(c) 2007 Fabian Würtz"); + about->setCopyrightStatement("(c) 2010 Timothy Pearson\n(c) 2007 Fabian Würtz"); about->addAuthor("Timothy Pearson (Trinity Project)", I18N_NOOP("Developer"), "kb9vqf@pearsoncomputing.net", "http://trinity.pearsoncomputing.net"); about->addAuthor("Fabian Würtz (xadras)", I18N_NOOP("Developer"), "xadras@sidux.com", "http://linux.wuertz.org/"); diff --git a/kdpkg-install/sh/kdpkg-sh b/kdpkg-install/sh/kdpkg-sh index 59b3ad1..0e2df8a 100755 --- a/kdpkg-install/sh/kdpkg-sh +++ b/kdpkg-install/sh/kdpkg-sh @@ -40,7 +40,7 @@ if [ "$1" == "install" ]; then else echo "" echo "Errors were encountered while installing your package" - echo "Please press enter to continue" + echo "Please press enter to exit" read fi fi |