Hello community,
here is the log from the commit of package kpackagekit for openSUSE:Factory
checked in at Tue Jul 28 00:03:01 CEST 2009.
--------
--- KDE/kpackagekit/kpackagekit.changes 2009-06-08 16:05:21.000000000 +0200
+++ kpackagekit/kpackagekit.changes 2009-07-25 23:28:20.000000000 +0200
@@ -1,0 +2,9 @@
+Sat Jul 25 22:40:53 CEST 2009 - beineri@opensuse.org
+
+- 0.4.1.1
+- With KDE >= 4.2.3 persistent notifications are working again so
+ the code to use it was commented out
+- Getting duplicated updates was trully fixed
+- Added "details" button on error notifications
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
84745-kpackagekit-0.4.1.tar.bz2
New:
----
84745-kpackagekit-0.4.1.1.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ kpackagekit.spec ++++++
--- /var/tmp/diff_new_pack.0vZ6Rv/_old 2009-07-28 00:01:46.000000000 +0200
+++ /var/tmp/diff_new_pack.0vZ6Rv/_new 2009-07-28 00:01:46.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package kpackagekit (Version 0.4.1)
+# spec file for package kpackagekit (Version 0.4.1.1)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,7 +19,7 @@
Summary: KDE interface for PackageKit
Name: kpackagekit
-Version: 0.4.1
+Version: 0.4.1.1
Release: 1
License: GPL v3 only
Group: System/Packages
@@ -27,14 +27,13 @@
Source0: http://www.kde-apps.org/CONTENT/content-files/84745-kpackagekit-%{version}.tar.bz2
Url: http://www.kde-apps.org/content/show.php/KPackageKit?content=84745
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: libkde4-devel
-BuildRequires: libpackagekit-qt11-devel
-Requires: libpackagekit-qt11
+BuildRequires: libkde4-devel libpackagekit-qt11-devel
Requires: PackageKit
Patch: desktop.diff
+%kde4_runtime_requires
%description
-KDE interface for PackageKit
+KDE interface for PackageKit package management.
@@ -73,6 +72,7 @@
%makeinstall
cd ..
%suse_update_desktop_file kpackagekit
+%kde_post_install
%clean
++++++ 84745-kpackagekit-0.4.1.tar.bz2 -> 84745-kpackagekit-0.4.1.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/AddRm/KpkAddRm.cpp new/KPackageKit/AddRm/KpkAddRm.cpp
--- old/KPackageKit/AddRm/KpkAddRm.cpp 2009-06-05 04:29:41.000000000 +0200
+++ new/KPackageKit/AddRm/KpkAddRm.cpp 2009-06-11 04:46:10.000000000 +0200
@@ -404,7 +404,7 @@
void KpkAddRm::save()
{
- KpkReviewChanges *frm = new KpkReviewChanges(m_pkg_model_main->selectedPackages(), this);
+ QPointer<KpkReviewChanges> frm = new KpkReviewChanges(m_pkg_model_main->selectedPackages(), this);
frm->setTitle(i18n("Review Changes"));
if (frm->exec() == QDialog::Accepted) {
m_pkg_model_main->uncheckAll();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/KPackageKit/KpkBackendDetails.ui new/KPackageKit/KPackageKit/KpkBackendDetails.ui
--- old/KPackageKit/KPackageKit/KpkBackendDetails.ui 2009-06-05 04:30:06.000000000 +0200
+++ new/KPackageKit/KPackageKit/KpkBackendDetails.ui 2009-06-11 04:46:10.000000000 +0200
@@ -6,13 +6,10 @@
<rect>
<x>0</x>
<y>0</y>
- <width>399</width>
+ <width>407</width>
<height>454</height>
</rect>
</property>
- <property name="windowTitle">
- <string>Form</string>
- </property>
<layout class="QGridLayout" name="gridLayout_4">
<property name="margin">
<number>0</number>
@@ -26,7 +23,7 @@
</sizepolicy>
</property>
<property name="title">
- <string>General</string>
+ <string>About Backend</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
@@ -39,7 +36,7 @@
<item row="0" column="1">
<widget class="QLabel" name="nameL">
<property name="text">
- <string>name</string>
+ <string>backend name here</string>
</property>
</widget>
</item>
@@ -53,7 +50,7 @@
<item row="1" column="1">
<widget class="QLabel" name="authorL">
<property name="text">
- <string>author</string>
+ <string>backend author name here</string>
</property>
</widget>
</item>
@@ -484,7 +481,7 @@
<bool>false</bool>
</property>
<property name="text">
- <string>Visible</string>
+ <string>Package is visible</string>
</property>
<property name="checkable">
<bool>true</bool>
@@ -532,7 +529,7 @@
<bool>false</bool>
</property>
<property name="text">
- <string>Free</string>
+ <string>Free software</string>
</property>
<property name="checkable">
<bool>true</bool>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/SmartIcon/KPackageKitSmartIcon.cpp new/KPackageKit/SmartIcon/KPackageKitSmartIcon.cpp
--- old/KPackageKit/SmartIcon/KPackageKitSmartIcon.cpp 2009-06-05 04:29:39.000000000 +0200
+++ new/KPackageKit/SmartIcon/KPackageKitSmartIcon.cpp 2009-06-11 04:46:09.000000000 +0200
@@ -44,15 +44,18 @@
this, SLOT(close()));
m_trayIcon = new KpkTransactionTrayIcon(this);
- connect(m_trayIcon, SIGNAL(close()), this, SLOT(prepareToClose()));
+ connect(m_trayIcon, SIGNAL(close()),
+ this, SLOT(prepareToClose()));
// This MUST be called after connecting all the signals or slots!
QTimer::singleShot(0, m_trayIcon, SLOT(checkTransactionList()));
m_updateIcon = new KpkUpdateIcon(this);
- connect(m_updateIcon, SIGNAL(close()), this, SLOT(prepareToClose()));
+ connect(m_updateIcon, SIGNAL(close()),
+ this, SLOT(prepareToClose()));
m_distroUpgrade = new KpkDistroUpgrade(this);
- connect(m_distroUpgrade, SIGNAL(close()), this, SLOT(prepareToClose()));
+ connect(m_distroUpgrade, SIGNAL(close()),
+ this, SLOT(prepareToClose()));
m_interface = new KpkInterface(this);
// connect the update signal from DBus to our update and distro classes
@@ -62,6 +65,8 @@
m_distroUpgrade, SLOT(checkDistroUpgrades()));
m_transWatcher = new KpkTransactionWatcher(this);
+ connect(m_transWatcher, SIGNAL(close()),
+ this, SLOT(prepareToClose()));
// connect the watch transaction coming through DBus to our watcher
connect(m_interface, SIGNAL(watchTransaction(const QString &)),
m_transWatcher, SLOT(watchTransaction(const QString &)));
@@ -98,6 +103,10 @@
if (m_distroUpgrade && m_distroUpgrade->isRunning()) {
return true;
}
+ if (m_transWatcher && m_transWatcher->isRunning()) {
+ return true;
+ }
+
return false;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/SmartIcon/KpkDistroUpgrade.cpp new/KPackageKit/SmartIcon/KpkDistroUpgrade.cpp
--- old/KPackageKit/SmartIcon/KpkDistroUpgrade.cpp 2009-06-05 04:29:39.000000000 +0200
+++ new/KPackageKit/SmartIcon/KpkDistroUpgrade.cpp 2009-06-11 04:46:09.000000000 +0200
@@ -54,9 +54,8 @@
Q_UNUSED(type)
kDebug() << "Distro upgrade found!" << name << description;
increaseRunning();
- // TODO kde4.2 does not work with KNotification::Persistent, when it's fixed we move back
- // otherwise we will leak
- KNotification *notify = new KNotification("DistroUpgradeAvailable", 0, KNotification::CloseOnTimeout);
+
+ KNotification *notify = new KNotification("DistroUpgradeAvailable", 0, KNotification::Persistent);
QString text;
text = i18n("Distribution upgrade available") + "<br/>";
@@ -70,14 +69,14 @@
connect(notify, SIGNAL(activated(uint)),
this, SLOT(handleDistroUpgradeAction(uint)));
connect(notify, SIGNAL(closed()),
- this , SLOT(handleDistroUpgradeActionClosed()));
+ this , SLOT(decreaseRunning()));
notify->sendEvent();
}
void KpkDistroUpgrade::handleDistroUpgradeAction(uint action)
{
// get the sender cause there might be more than one
- KNotification *notify = (KNotification *) sender();
+ KNotification *notify = qobject_cast(sender());
switch(action) {
case 1:
// Check to see if there isn't another process running
@@ -102,12 +101,6 @@
notify->close();
}
-void KpkDistroUpgrade::handleDistroUpgradeActionClosed()
-{
- kDebug();
- decreaseRunning();
-}
-
void KpkDistroUpgrade::distroUpgradeFinished(int exitCode, QProcess::ExitStatus exitStatus)
{
decreaseRunning();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/SmartIcon/KpkDistroUpgrade.h new/KPackageKit/SmartIcon/KpkDistroUpgrade.h
--- old/KPackageKit/SmartIcon/KpkDistroUpgrade.h 2009-06-05 04:29:39.000000000 +0200
+++ new/KPackageKit/SmartIcon/KpkDistroUpgrade.h 2009-06-11 04:46:09.000000000 +0200
@@ -42,7 +42,6 @@
void handleDistroUpgradeAction(uint action);
void distroUpgradeError(QProcess::ProcessError error);
void distroUpgradeFinished(int exitCode, QProcess::ExitStatus exitStatus);
- void handleDistroUpgradeActionClosed();
private:
QProcess *m_distroUpgradeProcess;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/SmartIcon/KpkTransactionTrayIcon.cpp new/KPackageKit/SmartIcon/KpkTransactionTrayIcon.cpp
--- old/KPackageKit/SmartIcon/KpkTransactionTrayIcon.cpp 2009-06-05 04:29:39.000000000 +0200
+++ new/KPackageKit/SmartIcon/KpkTransactionTrayIcon.cpp 2009-06-11 04:46:09.000000000 +0200
@@ -149,7 +149,6 @@
void KpkTransactionTrayIcon::createTransactionDialog(Transaction *t)
{
- kDebug();
increaseRunning();
// we need to close on finish otherwise smart-icon will timeout
KpkTransaction *trans = new KpkTransaction(t, KpkTransaction::CloseOnFinish, m_menu);
@@ -172,7 +171,7 @@
void KpkTransactionTrayIcon::transactionListChanged(const QListPackageKit::Transaction* &tids)
{
- kDebug() << tids.size();
+// kDebug() << tids.size();
if (tids.size()) {
setCurrentTransaction(tids.first());
} else {
@@ -347,10 +346,10 @@
void KpkTransactionTrayIcon::requireRestart(PackageKit::Client::RestartType type, Package *pkg)
{
-// decreaseRunning(); //TODO make it persistent when kde fixes that
+ increaseRunning();
m_restartPackages << pkg->name();
- KNotification *notify = new KNotification("RestartRequired");
+ KNotification *notify = new KNotification("RestartRequired", 0, KNotification::Persistent);
QString text("<b>" + i18n("The system update has completed") + "</b>");
text.append("<br />" + KpkStrings::restartType(type));
notify->setText(text);
@@ -359,11 +358,11 @@
switch (type) {
case Client::RestartSystem :
notify->setPixmap(KpkIcons::restartIcon(type).pixmap(64, 64));
- actions << i18n("Restart");
+ actions << i18nc("Restart the computer", "Restart");
actions << i18n("Not now");
m_restartType = Client::RestartSystem;
m_restartAction->setIcon(KpkIcons::restartIcon(type));
- m_restartAction->setText(i18n("Restart"));
+ m_restartAction->setText(i18nc("Restart the computer", "Restart"));
break;
case Client::RestartSession :
notify->setPixmap(KpkIcons::restartIcon(type).pixmap(64, 64));
@@ -392,6 +391,8 @@
notify->setActions(actions);
connect(notify, SIGNAL(activated(uint)),
this, SLOT(restartActivated(uint)));
+ connect(notify, SIGNAL(closed()),
+ this, SLOT(decreaseRunning()));
notify->sendEvent();
}
@@ -402,7 +403,7 @@
logout();
}
// in persistent mode we need to manually close it
-// notify->close();
+ qobject_cast(sender())->close();
}
void KpkTransactionTrayIcon::logout()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/SmartIcon/KpkTransactionWatcher.cpp new/KPackageKit/SmartIcon/KpkTransactionWatcher.cpp
--- old/KPackageKit/SmartIcon/KpkTransactionWatcher.cpp 2009-06-05 04:29:39.000000000 +0200
+++ new/KPackageKit/SmartIcon/KpkTransactionWatcher.cpp 2009-06-11 04:46:09.000000000 +0200
@@ -25,8 +25,11 @@
#include <KNotification>
#include <KIcon>
+#include <KMessageBox>
#include <KDebug>
+Q_DECLARE_METATYPE(PackageKit::Client::ErrorType)
+
KpkTransactionWatcher::KpkTransactionWatcher(QObject *parent)
: KpkAbstractIsRunning(parent)
{
@@ -41,14 +44,14 @@
foreach(Transaction *trans, m_hiddenTransactions) {
if (trans->tid() == tid) {
// Oops we are already watching this one
- kDebug() << "Oops we are already watching this one" << tid;
+// kDebug() << "Oops we are already watching this one" << tid;
return;
}
}
foreach(Transaction *trans, Client::instance()->getTransactions()) {
if (trans->tid() == tid) {
// found it let's start watching
- kDebug() << "found it let's start watching" << tid;
+// kDebug() << "found it let's start watching" << tid;
m_hiddenTransactions.append(trans);
connect(trans, SIGNAL(finished(PackageKit::Transaction::ExitStatus, uint)),
this, SLOT(finished(PackageKit::Transaction::ExitStatus, uint)));
@@ -64,7 +67,7 @@
foreach(Transaction *trans, m_hiddenTransactions) {
if (trans->tid() == tid) {
// Found it, let's remove
- kDebug() << "found it let's remove" << tid;
+// kDebug() << "found it let's remove" << tid;
m_hiddenTransactions.removeOne(trans);
// disconnect to not show any notification
trans->disconnect();
@@ -83,53 +86,40 @@
void KpkTransactionWatcher::errorCode(PackageKit::Client::ErrorType err, const QString &details)
{
- Q_UNUSED(details)
- // TODO add a details button to show details in a message box
- // do not forget to increase count ^^
- KNotification* errorNotification = new KNotification("TransactionError", 0, KNotification::Persistent);
- errorNotification->setFlags(KNotification::Persistent);
- errorNotification->setText("<b>"+KpkStrings::error(err)+"</b><br />"+KpkStrings::errorMessage(err));
-// QStringList actions;
-// actions << i18n("Details");
-// errorNotification->setActions(actions);
+ increaseRunning();
+ KNotification *notify = new KNotification("TransactionError", 0, KNotification::Persistent);
+ notify->setText("<b>"+KpkStrings::error(err)+"</b><br />"+KpkStrings::errorMessage(err));
+ notify->setProperty("ErrorType", QVariant::fromValue(err));
+ notify->setProperty("Details", details);
+ QStringList actions;
+ actions << i18n("Details") << i18n("Ignore");
+ notify->setActions(actions);
KIcon icon("dialog-error");
// Use QSize for proper icon
- errorNotification->setPixmap(icon.pixmap(QSize(128, 128)));
- errorNotification->sendEvent();
-}
+ notify->setPixmap(icon.pixmap(QSize(128, 128)));
+ connect(notify, SIGNAL(activated(uint)),
+ this, SLOT(errorActivated(uint)));
+ connect(notify, SIGNAL(closed()),
+ this, SLOT(decreaseRunning()));
+ notify->sendEvent();
+}
+
+void KpkTransactionWatcher::errorActivated(uint action)
+{
+ KNotification *notify = qobject_cast(sender());
+ // if the user clicked "Details"
+ if (action == 1) {
+ PackageKit::Client::ErrorType error = notify->property("ErrorType").valuePackageKit::Client::ErrorType();
+ QString details = notify->property("Details").toString();
+ KMessageBox::detailedSorry(0,
+ KpkStrings::errorMessage(error),
+ QString(details).replace('\n', "<br />"),
+ KpkStrings::error(error),
+ KMessageBox::Notify);
+ }
-// //FIXME: Implement the proper dbus calls to restart things.
-// void KpkTransactionWatcher::showRestartMessage(PackageKit::Client::RestartType type, const QString &details)
-// {
-// if (type==Client::RestartNone) {
-// return;
-// }
-// KNotification *notify = new KNotification("RestartRequired");
-// QString text;
-// QStringList events;
-// KIcon icon;
-// switch(type) {
-// case Client::RestartApplication:
-// text = i18n("Restart the application for system changes to take effect.");
-// //FIXME: Need a way to detect which program it is
-// icon = KIcon("window-close");
-// break;
-// case Client::RestartSession:
-// text = i18n("You must logout and log back in for system changes to take effect.");
-// icon = KIcon("system-restart"); //FIXME: find the logout icon
-// break;
-// case Client::RestartSystem:
-// text = i18n("Please restart your computer for system changes to take effect.");
-// icon = KIcon("system-restart");
-// break;
-// case Client::RestartNone:
-// case Client::UnknownRestartType:
-// return;
-// }
-// // Use QSize for proper icon
-// notify->setPixmap(icon.pixmap(QSize(128, 128)));
-// notify->setText("<b>"+text+"</b><br />"+details);
-// notify->sendEvent();
-// }
+ // in persistent mode we need to manually close it
+ notify->close();
+}
#include "KpkTransactionWatcher.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/SmartIcon/KpkTransactionWatcher.h new/KPackageKit/SmartIcon/KpkTransactionWatcher.h
--- old/KPackageKit/SmartIcon/KpkTransactionWatcher.h 2009-06-05 04:29:39.000000000 +0200
+++ new/KPackageKit/SmartIcon/KpkTransactionWatcher.h 2009-06-11 04:46:09.000000000 +0200
@@ -41,7 +41,7 @@
private slots:
void errorCode(PackageKit::Client::ErrorType, const QString&);
-// void showRestartMessage(PackageKit::Client::RestartType, const QString&);
+ void errorActivated(uint action);
void finished(PackageKit::Transaction::ExitStatus status, uint time);
private:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/SmartIcon/KpkUpdateIcon.cpp new/KPackageKit/SmartIcon/KpkUpdateIcon.cpp
--- old/KPackageKit/SmartIcon/KpkUpdateIcon.cpp 2009-06-05 04:29:39.000000000 +0200
+++ new/KPackageKit/SmartIcon/KpkUpdateIcon.cpp 2009-06-11 04:46:09.000000000 +0200
@@ -55,9 +55,9 @@
// this, SLOT(showSettings()));
// m_icon->contextMenu()->addAction(m_icon->actionCollection()->action(KStandardAction::name(KStandardAction::Preferences)));
- int m_inhibitCookie = Solid::PowerManagement::beginSuppressingSleep( i18n("Installing updates.") );
- if (m_inhibitCookie == -1)
- kDebug() << "Sleep suppression denied!";
+// int m_inhibitCookie = Solid::PowerManagement::beginSuppressingSleep( i18n("Installing updates.") );
+// if (m_inhibitCookie == -1)
+// kDebug() << "Sleep suppression denied!";
}
KpkUpdateIcon::~KpkUpdateIcon()
@@ -159,11 +159,8 @@
foreach(Package *p, m_updateList) {
packageGroups[p->state()].append(p);
- }
-
- foreach(const Package::State &state, packageGroups.keys()) {
- if (state>highState) {
- highState = state;
+ if (p->state() > highState) {
+ highState = p->state();
}
}
@@ -206,7 +203,7 @@
{
Q_UNUSED(runtime)
if (m_updateList.size() > 0) {
- kDebug() << "Found " << m_updateList.size() << " updates";
+// kDebug() << "Found " << m_updateList.size() << " updates";
Package::State highState = Package::StateInstalled;
//FIXME: This assumes that PackageKit shares our priority ranking.
foreach(Package *p, m_updateList) {
@@ -221,11 +218,11 @@
KConfigGroup checkUpdateGroup(&config, "CheckUpdate");
uint updateType = (uint) checkUpdateGroup.readEntry("autoUpdate", KpkEnum::AutoUpdateDefault);
if (updateType == KpkEnum::None) {
- kDebug() << "None.";
+// kDebug() << "None.";
notifyUpdates();
} else {
if (updateType == KpkEnum::All) {
- kDebug() << "All";
+// kDebug() << "All";
Client::instance()->setProxy(KProtocolManager::proxyFor("http"), KProtocolManager::proxyFor("ftp"));
if (Transaction* t = Client::instance()->updateSystem()) {
connect(t, SIGNAL(finished(PackageKit::Transaction::ExitStatus, uint)),
@@ -240,12 +237,12 @@
autoInstallNotify->sendEvent();
increaseRunning();
} else {
- kDebug() << "All Trans failed.";
+// kDebug() << "All Trans failed.";
notifyUpdates();
}
} else {
// Defaults to security
- kDebug() << "Security";
+// kDebug() << "Security";
QListPackageKit::Package* updateList;
foreach(PackageKit::Package *package, m_updateList) {
if (package->state() == Package::StateSecurity) {
@@ -267,11 +264,11 @@
autoInstallNotify->sendEvent();
increaseRunning();
} else {
- kDebug() << "security Trans failed.";
+// kDebug() << "security Trans failed.";
notifyUpdates();
}
} else {
- kDebug() << "No security updates.";
+// kDebug() << "No security updates.";
notifyUpdates();
}
}
@@ -307,7 +304,7 @@
void KpkUpdateIcon::handleUpdateAction(uint action)
{
- qDebug() << "action" << action;
+// kDebug() << "action" << action;
switch(action) {
case 1:
showUpdates();
@@ -329,7 +326,7 @@
void KpkUpdateIcon::handleUpdateActionClosed()
{
- kDebug();
+// kDebug();
m_updateNotify = 0;
decreaseRunning();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/SmartIcon/main.cpp new/KPackageKit/SmartIcon/main.cpp
--- old/KPackageKit/SmartIcon/main.cpp 2009-06-05 04:29:39.000000000 +0200
+++ new/KPackageKit/SmartIcon/main.cpp 2009-06-11 04:46:09.000000000 +0200
@@ -50,6 +50,5 @@
}
kpackagekit::KPackageKit_Smart_Icon app;
- app.exec();
- return 0;
+ return app.exec();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/Updater/KpkUpdate.cpp new/KPackageKit/Updater/KpkUpdate.cpp
--- old/KPackageKit/Updater/KpkUpdate.cpp 2009-06-05 04:29:40.000000000 +0200
+++ new/KPackageKit/Updater/KpkUpdate.cpp 2009-06-11 04:46:09.000000000 +0200
@@ -38,7 +38,7 @@
{
setupUi(this);
- updatePB->setIcon(KpkIcons::getIcon("package-update"));
+ selectAllPB->setIcon(KpkIcons::getIcon("package-update"));
refreshPB->setIcon(KpkIcons::getIcon("view-refresh"));
historyPB->setIcon(KpkIcons::getIcon("view-history"));
transactionBar->setBehaviors(KpkTransactionBar::AutoHide);
@@ -91,10 +91,9 @@
}
}
-void KpkUpdate::on_updatePB_clicked()
+void KpkUpdate::on_selectAllPB_clicked()
{
m_pkg_model_updates->checkAll();
- applyUpdates();
}
void KpkUpdate::load()
@@ -214,7 +213,7 @@
void KpkUpdate::on_historyPB_clicked()
{
- KpkHistory *frm = new KpkHistory(this);
+ QPointer<KpkHistory> frm = new KpkHistory(this);
frm->exec();
delete frm;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/Updater/KpkUpdate.h new/KPackageKit/Updater/KpkUpdate.h
--- old/KPackageKit/Updater/KpkUpdate.h 2009-06-05 04:29:40.000000000 +0200
+++ new/KPackageKit/Updater/KpkUpdate.h 2009-06-11 04:46:09.000000000 +0200
@@ -50,7 +50,7 @@
void refresh();
private slots:
- void on_updatePB_clicked();
+ void on_selectAllPB_clicked();
void on_refreshPB_clicked();
void on_historyPB_clicked();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/Updater/KpkUpdate.ui new/KPackageKit/Updater/KpkUpdate.ui
--- old/KPackageKit/Updater/KpkUpdate.ui 2009-06-05 04:29:40.000000000 +0200
+++ new/KPackageKit/Updater/KpkUpdate.ui 2009-06-11 04:46:09.000000000 +0200
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>KpkUpdate</class>
- <widget class="QWidget" name="KpkUpdate" >
- <property name="geometry" >
+ <widget class="QWidget" name="KpkUpdate">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,100 +10,100 @@
<height>423</height>
</rect>
</property>
- <property name="locale" >
- <locale country="UnitedStates" language="English" />
+ <property name="locale">
+ <locale language="English" country="UnitedStates"/>
</property>
- <layout class="QGridLayout" name="gridLayout" >
- <property name="margin" >
+ <layout class="QGridLayout" name="gridLayout">
+ <property name="margin">
<number>0</number>
</property>
- <item row="2" column="0" >
- <widget class="QTreeView" name="packageView" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="MinimumExpanding" hsizetype="Expanding" >
+ <item row="2" column="0">
+ <widget class="QTreeView" name="packageView">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="horizontalScrollBarPolicy" >
+ <property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
- <property name="autoScroll" >
+ <property name="autoScroll">
<bool>false</bool>
</property>
- <property name="showDropIndicator" stdset="0" >
+ <property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
- <property name="alternatingRowColors" >
+ <property name="alternatingRowColors">
<bool>true</bool>
</property>
- <property name="rootIsDecorated" >
+ <property name="rootIsDecorated">
<bool>true</bool>
</property>
- <property name="itemsExpandable" >
+ <property name="itemsExpandable">
<bool>true</bool>
</property>
- <property name="sortingEnabled" >
+ <property name="sortingEnabled">
<bool>true</bool>
</property>
- <property name="animated" >
+ <property name="animated">
<bool>false</bool>
</property>
- <property name="allColumnsShowFocus" >
+ <property name="allColumnsShowFocus">
<bool>false</bool>
</property>
- <property name="headerHidden" >
+ <property name="headerHidden">
<bool>false</bool>
</property>
- <property name="expandsOnDoubleClick" >
+ <property name="expandsOnDoubleClick">
<bool>true</bool>
</property>
</widget>
</item>
- <item row="3" column="0" >
- <widget class="KpkTransactionBar" native="1" name="transactionBar" />
+ <item row="3" column="0">
+ <widget class="KpkTransactionBar" name="transactionBar" native="true"/>
</item>
- <item row="4" column="0" >
- <layout class="QHBoxLayout" name="horizontalLayout_2" >
+ <item row="4" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
- <widget class="KPushButton" name="updatePB" >
- <property name="text" >
- <string>Apply all available updates</string>
+ <widget class="KPushButton" name="selectAllPB">
+ <property name="text">
+ <string>Select all updates</string>
</property>
</widget>
</item>
<item>
- <widget class="KPushButton" name="refreshPB" >
- <property name="text" >
+ <widget class="KPushButton" name="refreshPB">
+ <property name="text">
<string>Refresh</string>
</property>
</widget>
</item>
<item>
- <widget class="KPushButton" name="historyPB" >
- <property name="text" >
+ <widget class="KPushButton" name="historyPB">
+ <property name="text">
<string>History</string>
</property>
</widget>
</item>
</layout>
</item>
- <item row="0" column="0" >
- <widget class="QScrollArea" name="distroUpgradesSA" >
- <property name="maximumSize" >
+ <item row="0" column="0">
+ <widget class="QScrollArea" name="distroUpgradesSA">
+ <property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
- <property name="frameShadow" >
+ <property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
- <property name="widgetResizable" >
+ <property name="widgetResizable">
<bool>true</bool>
</property>
- <widget class="QWidget" name="scrollAreaWidgetContents" >
- <property name="geometry" >
+ <widget class="QWidget" name="scrollAreaWidgetContents">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -110,13 +111,13 @@
<height>94</height>
</rect>
</property>
- <layout class="QVBoxLayout" name="verticalLayout" />
+ <layout class="QVBoxLayout" name="verticalLayout"/>
</widget>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="Line" name="line" >
- <property name="orientation" >
+ <item row="1" column="0">
+ <widget class="Line" name="line">
+ <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
@@ -132,7 +133,7 @@
<customwidget>
<class>KpkTransactionBar</class>
<extends>QWidget</extends>
- <header location="global" >KpkTransactionBar.h</header>
+ <header location="global">KpkTransactionBar.h</header>
<container>1</container>
</customwidget>
</customwidgets>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/libkpackagekit/KpkPackageModel.cpp new/KPackageKit/libkpackagekit/KpkPackageModel.cpp
--- old/KPackageKit/libkpackagekit/KpkPackageModel.cpp 2009-06-05 04:29:41.000000000 +0200
+++ new/KPackageKit/libkpackagekit/KpkPackageModel.cpp 2009-06-11 04:46:09.000000000 +0200
@@ -86,32 +86,44 @@
if (column == 0) {
if (order == Qt::DescendingOrder) {
qSort(m_packages.begin(), m_packages.end(), packageNameSortGreaterThan);
- foreach(const Package::State &group, m_groups.keys()) {
- qSort(m_groups[group].begin(), m_groups[group].end(), packageNameSortGreaterThan);
+
+ QMap >::const_iterator i = m_groups.constBegin();
+ while (i != m_groups.constEnd()) {
+ qSort(m_groups[i.key()].begin(), m_groups[i.key()].end(), packageNameSortGreaterThan);
+ ++i;
}
} else {
qSort(m_packages.begin(), m_packages.end(), packageNameSortLessThan);
- foreach(const Package::State &group, m_groups.keys()) {
- qSort(m_groups[group].begin(), m_groups[group].end(), packageNameSortLessThan);
+
+ QMap >::const_iterator i = m_groups.constBegin();
+ while (i != m_groups.constEnd()) {
+ qSort(m_groups[i.key()].begin(), m_groups[i.key()].end(), packageNameSortLessThan);
+ ++i;
}
}
} else if (column == 1) {
if (order == Qt::DescendingOrder){
descendingSelectionSorter sort(m_checkedPackages);
qSort(m_packages.begin(), m_packages.end(), sort);
- foreach(const Package::State &group, m_groups.keys()) {
- qSort(m_groups[group].begin(), m_groups[group].end(), sort);
+
+ QMap >::const_iterator i = m_groups.constBegin();
+ while (i != m_groups.constEnd()) {
+ qSort(m_groups[i.key()].begin(), m_groups[i.key()].end(), sort);
+ ++i;
}
} else {
ascendingSelectionSorter sort(m_checkedPackages);
qSort(m_packages.begin(), m_packages.end(), sort);
- foreach(const Package::State &group, m_groups.keys()) {
- qSort(m_groups[group].begin(), m_groups[group].end(), sort);
+
+ QMap >::const_iterator i = m_groups.constBegin();
+ while (i != m_groups.constEnd()) {
+ qSort(m_groups[i.key()].begin(), m_groups[i.key()].end(), sort);
+ ++i;
}
}
}
if (m_grouped) {
- for (int i = 0;i >::const_iterator i = m_groups.constBegin();
+ while (i != m_groups.constEnd()) {
+ QModelIndex groupIndex = index(m_groups.keys().indexOf(i.key()), 0, QModelIndex());
emit dataChanged(index(0, 1, groupIndex),
- index(m_groups[group].size(),
+ index(m_groups[i.key()].size(),
1,
groupIndex));
+ ++i;
}
}
}
@@ -533,12 +547,14 @@
emit dataChanged(createIndex(0, 1),
createIndex(m_groups.size(), 1));
if (m_grouped) {
- foreach(const Package::State &group, m_groups.keys()) {
- QModelIndex groupIndex = index(m_groups.keys().indexOf(group), 0, QModelIndex());
+ QMap >::const_iterator i = m_groups.constBegin();
+ while (i != m_groups.constEnd()) {
+ QModelIndex groupIndex = index(m_groups.keys().indexOf(i.key()), 0, QModelIndex());
emit dataChanged(index(0, 1, groupIndex),
- index(m_groups[group].size(),
+ index(m_groups[i.key()].size(),
1,
groupIndex));
+ ++i;
}
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/libkpackagekit/KpkReviewChanges.cpp new/KPackageKit/libkpackagekit/KpkReviewChanges.cpp
--- old/KPackageKit/libkpackagekit/KpkReviewChanges.cpp 2009-06-05 04:29:41.000000000 +0200
+++ new/KPackageKit/libkpackagekit/KpkReviewChanges.cpp 2009-06-11 04:46:09.000000000 +0200
@@ -142,8 +142,9 @@
connect(m_transactionReq, SIGNAL(errorCode(PackageKit::Client::ErrorType, const QString &)),
this, SLOT(errorCode(PackageKit::Client::ErrorType, const QString &)));
// Create a Transaction dialog to don't upset the user
- KpkTransaction* reqFinder = new KpkTransaction(m_transactionReq, KpkTransaction::CloseOnFinish | KpkTransaction::Modal, this);
+ QPointer<KpkTransaction> reqFinder = new KpkTransaction(m_transactionReq, KpkTransaction::CloseOnFinish | KpkTransaction::Modal, this);
reqFinder->exec();
+ delete reqFinder;
} else {
removePackages();
}
@@ -165,8 +166,9 @@
connect(m_transactionDep, SIGNAL(errorCode(PackageKit::Client::ErrorType, const QString &)),
this, SLOT(errorCode(PackageKit::Client::ErrorType, const QString &)));
// Create a Transaction dialog to don't upset the user
- KpkTransaction* reqFinder = new KpkTransaction(m_transactionDep, KpkTransaction::Modal | KpkTransaction::CloseOnFinish, this);
+ QPointer<KpkTransaction> reqFinder = new KpkTransaction(m_transactionDep, KpkTransaction::CloseOnFinish | KpkTransaction::Modal, this);
reqFinder->exec();
+ delete reqFinder;
} else {
installPackages();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/libkpackagekit/KpkStrings.cpp new/KPackageKit/libkpackagekit/KpkStrings.cpp
--- old/KPackageKit/libkpackagekit/KpkStrings.cpp 2009-06-05 04:29:40.000000000 +0200
+++ new/KPackageKit/libkpackagekit/KpkStrings.cpp 2009-06-11 04:46:09.000000000 +0200
@@ -666,28 +666,28 @@
} else {
switch (state) {
case Package::StateLow :
- return i18np("1 trivial update", "%1 trivial updates, %2 selected", updates, selected);
+ return i18np("%1 trivial update", "%1 trivial updates, %2 selected", updates, selected);
case Package::StateNormal :
return i18ncp("Type of update, in the case it's just an update",
- "1 update", "%1 updates, %2 selected", updates, selected);
+ "%1 update", "%1 updates, %2 selected", updates, selected);
case Package::StateImportant :
- return i18np("1 important update", "%1 important updates, %2 selected", updates, selected);
+ return i18np("%1 important update", "%1 important updates, %2 selected", updates, selected);
case Package::StateSecurity :
- return i18np("1 security update", "%1 security updates, %2 selected", updates, selected);
+ return i18np("%1 security update", "%1 security updates, %2 selected", updates, selected);
case Package::StateBugfix :
- return i18np("1 bug fix update", "%1 bug fix updates, %2 selected", updates, selected);
+ return i18np("%1 bug fix update", "%1 bug fix updates, %2 selected", updates, selected);
case Package::StateEnhancement :
- return i18np("1 enhancement update", "%1 enhancement updates, %2 selected", updates, selected);
+ return i18np("%1 enhancement update", "%1 enhancement updates, %2 selected", updates, selected);
case Package::StateBlocked :
// Blocked updates aren't selectable
- return i18np("1 blocked update", "%1 blocked updates", updates);
+ return i18np("%1 blocked update", "%1 blocked updates", updates);
case Package::StateInstalled :
- return i18np("1 installed package", "%1 installed packages, %2 selected to be removed", updates, selected);
+ return i18np("%1 installed package", "%1 installed packages, %2 selected to be removed", updates, selected);
case Package::StateAvailable :
- return i18np("1 available package", "%1 available packages, %2 selected to be installed", updates, selected);
+ return i18np("%1 available package", "%1 available packages, %2 selected to be installed", updates, selected);
default : // In this case we don't want to map all enums
kDebug() << "update info unrecognised: " << state;
- return i18np("1 unknown update", "%1 unknown updates", updates);
+ return i18np("%1 unknown update", "%1 unknown updates", updates);
}
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/libkpackagekit/KpkTransaction.cpp new/KPackageKit/libkpackagekit/KpkTransaction.cpp
--- old/KPackageKit/libkpackagekit/KpkTransaction.cpp 2009-06-05 04:29:41.000000000 +0200
+++ new/KPackageKit/libkpackagekit/KpkTransaction.cpp 2009-06-11 04:46:09.000000000 +0200
@@ -200,53 +200,51 @@
void KpkTransaction::finishedDialog()
{
- slotButtonClicked(KDialog::User1);
+ if (!d->finished) {
+ // We are going to hide the transaction,
+ // which can make the user even close System Settings or KPackageKit
+ // so we call the tray icon to keep watching the transaction so if the
+ // transaction receives some error we can display them
+ QDBusMessage message;
+ message = QDBusMessage::createMethodCall("org.kde.KPackageKitSmartIcon",
+ "/",
+ "org.kde.KPackageKitSmartIcon",
+ QLatin1String("WatchTransaction"));
+ message << qVariantFromValue(m_trans->tid());
+ QDBusMessage reply = QDBusConnection::sessionBus().call(message);
+ if (reply.type() != QDBusMessage::ReplyMessage) {
+ kWarning() << "Message did not receive a reply";
+ }
+ // Always disconnect BEFORE emitting finished
+ m_trans->disconnect();
+ emit kTransactionFinished(Success);
+ }
}
void KpkTransaction::slotButtonClicked(int button)
{
switch(button) {
- case KDialog::Cancel :
- kDebug() << "KDialog::Cancel";
- m_trans->cancel();
- m_flags |= CloseOnFinish;
- break;
- case KDialog::User1 :
- kDebug() << "KDialog::User1";
- if (!d->finished) {
- // We are going to hide the transaction,
- // which can make the user even close System Settings or KPackageKit
- // so we call the tray icon to keep watching the transaction so if the
- // transaction receives some error we can display them
- QDBusMessage message;
- message = QDBusMessage::createMethodCall("org.kde.KPackageKitSmartIcon",
- "/",
- "org.kde.KPackageKitSmartIcon",
- QLatin1String("WatchTransaction"));
- message << qVariantFromValue(m_trans->tid());
- QDBusMessage reply = QDBusConnection::sessionBus().call(message);
- if (reply.type() != QDBusMessage::ReplyMessage) {
- kWarning() << "Message did not receive a reply";
- }
- // Always disconnect BEFORE emitting finished
- m_trans->disconnect();
- emit kTransactionFinished(Success);
- }
- // If you call Close it will
- // come back to hunt you with Cancel
- done(KDialog::User1);
- break;
- case KDialog::Close :
- kDebug() << "KDialog::Close";
- // Always disconnect BEFORE emitting finished
- m_trans->disconnect();
- emit kTransactionFinished(Cancelled);
- done(KDialog::Close);
- break;
- case KDialog::Details :
- d->showDetails = !d->showDetails;
- default : // Should be only details
- KDialog::slotButtonClicked(button);
+ case KDialog::Cancel :
+ kDebug() << "KDialog::Cancel";
+ m_trans->cancel();
+ m_flags |= CloseOnFinish;
+ break;
+ case KDialog::User1 :
+ kDebug() << "KDialog::User1";
+ // when we're done finishedDialog() is called
+ done(KDialog::User1);
+ break;
+ case KDialog::Close :
+ kDebug() << "KDialog::Close";
+ // Always disconnect BEFORE emitting finished
+ m_trans->disconnect();
+ emit kTransactionFinished(Cancelled);
+ done(KDialog::Close);
+ break;
+ case KDialog::Details :
+ d->showDetails = !d->showDetails;
+ default : // Should be only details
+ KDialog::slotButtonClicked(button);
}
}
@@ -344,10 +342,11 @@
m_handlingActionRequired = true;
}
- KpkLicenseAgreement *frm = new KpkLicenseAgreement(info, true, this);
+ QPointer<KpkLicenseAgreement> frm = new KpkLicenseAgreement(info, true, this);
if (frm->exec() == KDialog::Yes && Client::instance()->acceptEula(info)) {
m_handlingActionRequired = false;
}
+ delete frm;
// Well try again, if fail will show the erroCode
emit kTransactionFinished(ReQueue);
@@ -388,12 +387,14 @@
m_handlingActionRequired = true;
}
- KpkRepoSig *frm = new KpkRepoSig(info, true, this);
+ QPointer<KpkRepoSig> frm = new KpkRepoSig(info, true, this);
if (frm->exec() == KDialog::Yes &&
Client::instance()->installSignature(info.type, info.keyId, info.package)) {
m_handlingActionRequired = false;
}
- kDebug() << "Requeue!";
+ delete frm;
+
+// kDebug() << "Requeue!";
emit kTransactionFinished(ReQueue);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/KPackageKit/libkpackagekit/version.h new/KPackageKit/libkpackagekit/version.h
--- old/KPackageKit/libkpackagekit/version.h 2009-06-05 04:48:25.000000000 +0200
+++ new/KPackageKit/libkpackagekit/version.h 2009-06-11 04:46:09.000000000 +0200
@@ -20,5 +20,5 @@
#ifndef KPKVERSION_H
#define KPKVERSION_H
-#define KPK_VERSION "0.4.1"
+#define KPK_VERSION "0.4.1.1"
#endif
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org