~ubuntu-branches/ubuntu/quantal/kpackagekit/quantal

« back to all changes in this revision

Viewing changes to SmartIcon/PkRemovePackageByFiles.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-06-17 11:32:37 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20100617113237-s47wgl3arijqam23
Tags: 0.6.0-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
 *   Copyright (C) 2009 by Daniel Nicoletti                                *
 
2
 *   Copyright (C) 2009-2010 by Daniel Nicoletti                           *
3
3
 *   dantti85-pk@yahoo.com.br                                              *
4
4
 *                                                                         *
5
5
 *   This program is free software; you can redistribute it and/or modify  *
70
70
        QString msg = "<h3>" + title + "</h3>" + message;
71
71
        KGuiItem searchBt = KStandardGuiItem::yes();
72
72
        searchBt.setText(i18nc("Search for a package and remove", "Search"));
73
 
        searchBt.setIcon(KIcon::KIcon("edit-find"));
 
73
        searchBt.setIcon(KIcon("edit-find"));
74
74
        int ret;
75
75
        ret = KMessageBox::questionYesNo(this,
76
76
                                        msg,
79
79
    }
80
80
 
81
81
    if (ret == KMessageBox::Yes) {
82
 
        Transaction *t = Client::instance()->searchFile(m_files,
83
 
                                                        Client::FilterInstalled);
 
82
        Transaction *t = Client::instance()->searchFiles(m_files,
 
83
                                                         Enum::FilterInstalled);
84
84
        if (t->error()) {
85
85
            QString msg(i18n("Failed to start search file transaction"));
86
86
            if (showWarning()) {
92
92
        } else {
93
93
            connect(t, SIGNAL(finished(PackageKit::Transaction::ExitStatus, uint)),
94
94
                    this, SLOT(resolveFinished(PackageKit::Transaction::ExitStatus, uint)));
95
 
            connect(t, SIGNAL(package(PackageKit::Package *)),
96
 
                    this, SLOT(addPackage(PackageKit::Package *)));
 
95
            connect(t, SIGNAL(package(PackageKit::QSharedPointer<PackageKit::Package>)),
 
96
                    this, SLOT(addPackage(PackageKit::QSharedPointer<PackageKit::Package>)));
97
97
            if (showProgress()) {
98
98
                KpkTransaction *trans = new KpkTransaction(t, KpkTransaction::CloseOnFinish);
99
99
                trans->show();
105
105
    }
106
106
}
107
107
 
108
 
void PkRemovePackageByFiles::searchFinished(PackageKit::Transaction::ExitStatus status,
 
108
void PkRemovePackageByFiles::searchFinished(PackageKit::Enum::Exit status,
109
109
                                            uint runtime)
110
110
{
111
111
    Q_UNUSED(runtime)
112
112
    kDebug() << "Finished.";
113
 
    if (status == Transaction::ExitSuccess) {
 
113
    if (status == Enum::ExitSuccess) {
114
114
        if (m_foundPackages.size()) {
115
115
            KpkReviewChanges *frm = new KpkReviewChanges(m_foundPackages, this);
116
116
            frm->setTitle(i18np("The following package will be removed",
137
137
    }
138
138
}
139
139
 
140
 
void PkRemovePackageByFiles::addPackage(PackageKit::Package *package)
 
140
void PkRemovePackageByFiles::addPackage(QSharedPointer<PackageKit::Package>package)
141
141
{
142
142
    m_foundPackages.append(package);
143
143
}