Merge lp:~manchicken/kubuntu-debug-installer/kubuntu-debug-installer into lp:kubuntu-debug-installer

Proposed by Michael D. Stemle, Jr.
Status: Superseded
Proposed branch: lp:~manchicken/kubuntu-debug-installer/kubuntu-debug-installer
Merge into: lp:kubuntu-debug-installer
Diff against target: 573 lines (+407/-9)
9 files modified
CMakeLists.txt (+2/-0)
src/CMakeLists.txt (+2/-0)
src/DebugFinder.cpp (+146/-3)
src/DebugFinder.h (+31/-4)
src/DebugInstaller.cpp (+3/-2)
src/LSBRelease.cpp (+66/-0)
src/LSBRelease.h (+43/-0)
src/QAptDecorator.cpp (+80/-0)
src/QAptDecorator.h (+34/-0)
To merge this branch: bzr merge lp:~manchicken/kubuntu-debug-installer/kubuntu-debug-installer
Reviewer Review Type Date Requested Status
Jonathan Thomas Pending
Review via email: mp+174915@code.launchpad.net

This proposal has been superseded by a proposal from 2013-07-17.

Description of the change

NOW we're ready for merging. This implements https://wiki.ubuntu.com/DebuggingProgramCrash#Debug_Symbol_Packages.

To post a comment you must log in.
Revision history for this message
Philip Muškovac (yofel) wrote :

I only took a quick glance on the merge, but I think you missed the "release" repository. You have X-updates, X-security and X-proposed, but I see no place where you add X without a suffix

103. By Michael D. Stemle, Jr. <email address hidden>

Added the base repo.

104. By Michael D. Stemle, Jr. <email address hidden>

Made change per JT's recommendation.

105. By Michael D. Stemle, Jr. <email address hidden>

Made a series of changes requested by Harold.

106. By Michael D. Stemle, Jr. <email address hidden>

Fixed some text formatting.

107. By Michael D. Stemle, Jr. <email address hidden>

Fixed some code indentation.

108. By Michael D. Stemle, Jr. <email address hidden>

Made a number of changes per Harald's list: https://code.launchpad.net/~manchicken/kubuntu-debug-installer/kubuntu-debug-installer/+merge/177273/comments/399863

Unmerged revisions

108. By Michael D. Stemle, Jr. <email address hidden>

Made a number of changes per Harald's list: https://code.launchpad.net/~manchicken/kubuntu-debug-installer/kubuntu-debug-installer/+merge/177273/comments/399863

107. By Michael D. Stemle, Jr. <email address hidden>

Fixed some code indentation.

106. By Michael D. Stemle, Jr. <email address hidden>

Fixed some text formatting.

105. By Michael D. Stemle, Jr. <email address hidden>

Made a series of changes requested by Harold.

104. By Michael D. Stemle, Jr. <email address hidden>

Made change per JT's recommendation.

103. By Michael D. Stemle, Jr. <email address hidden>

Added the base repo.

102. By Michael D. Stemle, Jr. <email address hidden>

Fixed a small bug when debug packages weren't found.

101. By Michael D. Stemle, Jr. <email address hidden>

Added the changes for sources.list and refreshing cache: https://wiki.ubuntu.com/DebuggingProgramCrash#Debug_Symbol_Packages

100. By Michael D. Stemle, Jr. <email address hidden>

I now have the sources add working.

99. By Michael D. Stemle, Jr. <email address hidden>

Adding LSB stuff from Herald Sitter (THANKS!) and adding some code to set up repos.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2010-09-16 13:06:47 +0000
+++ CMakeLists.txt 2013-07-17 00:34:26 +0000
@@ -4,6 +4,8 @@
4find_package(QApt REQUIRED)4find_package(QApt REQUIRED)
5include (KDE4Defaults)5include (KDE4Defaults)
66
7add_definitions(-DKDE_DEFAULT_DEBUG_AREA=8675309)
8
7macro_log_feature(QAPT_FOUND "QApt" "High-level Qt wrapper/Apt implementation around the Apt-pkg library"9macro_log_feature(QAPT_FOUND "QApt" "High-level Qt wrapper/Apt implementation around the Apt-pkg library"
8 "http://kubuntu.org" FALSE "" "Used to look up packages")10 "http://kubuntu.org" FALSE "" "Used to look up packages")
911
1012
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2010-09-16 14:19:01 +0000
+++ src/CMakeLists.txt 2013-07-17 00:34:26 +0000
@@ -2,6 +2,8 @@
2include_directories(${CMAKE_CURRENT_BINARY_DIR})2include_directories(${CMAKE_CURRENT_BINARY_DIR})
33
4set(installdbgsymbols_SRCS4set(installdbgsymbols_SRCS
5 QAptDecorator.cpp
6 LSBRelease.cpp
5 DebugFinder.cpp7 DebugFinder.cpp
6 DebugInstaller.cpp8 DebugInstaller.cpp
7 main.cpp9 main.cpp
810
=== modified file 'src/DebugFinder.cpp'
--- src/DebugFinder.cpp 2012-10-30 15:16:47 +0000
+++ src/DebugFinder.cpp 2013-07-17 00:34:26 +0000
@@ -2,6 +2,7 @@
2 Copyright © 2010 Harald Sitter <apachelogger@ubuntu.com>2 Copyright © 2010 Harald Sitter <apachelogger@ubuntu.com>
3 Copyright © 2010 Felix Geyer <debfx@fobos.de>3 Copyright © 2010 Felix Geyer <debfx@fobos.de>
4 Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org>4 Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org>
5 Copyright © 2013 Michael D. Stemle, Jr. <themanchicken@gmail.com>
56
6 This program is free software; you can redistribute it and/or7 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as8 modify it under the terms of the GNU General Public License as
@@ -21,18 +22,35 @@
21*/22*/
2223
23#include "DebugFinder.h"24#include "DebugFinder.h"
25#include "LSBRelease.h"
26#include "QAptDecorator.h"
2427
25#include <QtCore/QStringList>28#include <QtCore/QStringList>
26#include <QtCore/QThread>29#include <QtCore/QThread>
30#include <QtCore/QFile>
31#include <QtCore/QDir>
32#include <QtCore/QDirIterator>
33#include <QtCore/QTextStream>
2734
28#include <LibQApt/Backend>35#include <LibQApt/Backend>
36#include <LibQApt/SourceEntry>
37#include <LibQApt/SourcesList>
38#include <LibQApt/Transaction>
39#include <iostream>
40
41#include <KDebug>
42#include <KLocalizedString>
43#include <KMessageBox>
2944
30DebugFinder::DebugFinder(QObject *parent) :45DebugFinder::DebugFinder(QObject *parent) :
31 QObject(parent),46 QObject(parent),
32 m_backend(new QApt::Backend(this)),47 m_backend(new QApt::Backend(this)),
33 m_stop(false)48 m_stop(false)
34{49{
50 kDebug() << "INIT!!!!!\n";
35 m_backend->init();51 m_backend->init();
52
53 m_txn = NULL;
36}54}
3755
38QApt::Package *DebugFinder::getDbgPkg(QApt::Package *package)56QApt::Package *DebugFinder::getDbgPkg(QApt::Package *package)
@@ -69,17 +87,18 @@
69 return 0;87 return 0;
70}88}
7189
72void DebugFinder::find(const QString &file)90void DebugFinder::find()
73{91{
74 if (m_stop) {92 if (m_stop) {
75 return;93 return;
76 }94 }
7795
78 QApt::Package *package = m_backend->packageForFile(file);96 QApt::Package *package = m_backend->packageForFile(m_file);
7997
80 QApt::Package *dbgPkg = getDbgPkg(package);98 QApt::Package *dbgPkg = getDbgPkg(package);
81 if (!dbgPkg) {99 if (!dbgPkg) {
82 emit foundNoDbgPkg(file);100 kDebug() << "No debug package found for: " << m_file;
101 emit foundNoDbgPkg(m_file);
83 } else if (dbgPkg->isInstalled()) {102 } else if (dbgPkg->isInstalled()) {
84 emit alreadyInstalled();103 emit alreadyInstalled();
85 } else {104 } else {
@@ -91,3 +110,127 @@
91{110{
92 m_stop = true;111 m_stop = true;
93}112}
113
114void DebugFinder::startFinding(const QString &file)
115{
116 QString headerText = i18n("<b>Adding debug symbol sources</b>");
117 m_progress.setLabelText(headerText);
118 m_file = file;
119 connect(this, SIGNAL(updateFinishing()), this, SLOT(onUpdateFinished()));
120// connect(this, SIGNAL(sourcesModificationFinished()), m_backend, SLOT(updateCache()));
121
122 // Construct our list hard-coded sources...
123 LSBRelease lsb;
124 QString codename(lsb.codename());
125 QApt::SourceEntryList hcRepoList;
126 hcRepoList.append(QApt::SourceEntry(QString(REPO_ARG_BASE).arg(codename), QString(DDEB_REPO_FILE)));
127 hcRepoList.append(QApt::SourceEntry(QString(REPO_ARG_UPDATES).arg(codename), QString(DDEB_REPO_FILE)));
128 hcRepoList.append(QApt::SourceEntry(QString(REPO_ARG_SECURITY).arg(codename), QString(DDEB_REPO_FILE)));
129 hcRepoList.append(QApt::SourceEntry(QString(REPO_ARG_PROPOSED).arg(codename), QString(DDEB_REPO_FILE)));
130
131 // First, see if the source exists...
132 QApt::SourcesList sourceList(this);
133
134 int sourceCount = sourceList.entries().count();
135
136 foreach (QApt::SourceEntry repo, hcRepoList)
137 {
138 sourceList.addEntry(repo); // This method has a dup check
139 }
140 m_progress.progressBar()->setMaximum(100);
141
142 // If we affected the list, save!
143 if (sourceList.entries().count() > sourceCount) {
144 m_srcUpdated = 0;
145 sourceList.save();
146 kDebug() << "Entries saved, updating backend cache...";
147
148 m_txn = m_backend->updateCache();
149
150 m_txn->setLocale(QLatin1String(setlocale(LC_MESSAGES, 0)));
151
152 connect(&m_progress, SIGNAL(cancelClicked()), m_txn, SLOT(cancel()));
153 connect(m_txn, SIGNAL(errorOccurred(QApt::ErrorCode)), this, SLOT(onAptError(QApt::ErrorCode)));
154 connect(m_txn, SIGNAL(statusChanged(QApt::TransactionStatus)), this, SLOT(onTxnStatusChanged(QApt::TransactionStatus)));
155 connect(m_txn, SIGNAL(progressChanged(int)), this, SLOT(onProgressChanged(int)));
156 connect(m_txn, SIGNAL(finished(QApt::ExitStatus)), this, SLOT(onUpdateFinished()));
157
158 m_txn->run();
159 kDebug() << "FinishedStatus: " << QApt::FinishedStatus;
160 } else {
161 emit updateFinishing();
162 }
163
164 kDebug() << "Done with startFinding()!";
165}
166
167// The update is finished!
168void DebugFinder::onUpdateFinished()
169{
170 kDebug() << "I'm done.";
171 m_progress.progressBar()->setValue(100);
172
173 this->find();
174
175 return;
176}
177
178void DebugFinder::onTxnStatusChanged(QApt::TransactionStatus status)
179{
180 QString headerText;
181
182 kDebug() << "cache widget: transaction status changed" << status;
183
184 if (this->m_txn == NULL) {
185 kDebug() << "NULL transaction.";
186 return;
187 }
188
189 switch (status) {
190 case QApt::DownloadingStatus:
191 if (this->m_txn->role() == QApt::UpdateCacheRole)
192 {
193 headerText = i18n("<b>Updating software sources</b>");
194 }
195 else
196 {
197 headerText = i18n("<b>Downloading Packages</b>");
198 }
199
200 m_progress.setLabelText(headerText);
201 break;
202
203 case QApt::FinishedStatus:
204 headerText = i18n("<b>Finished.</b>");
205 m_progress.setLabelText(headerText);
206 break;
207
208 default:
209 break;
210 }
211}
212
213void DebugFinder::onAptError(QApt::ErrorCode errcode)
214{
215 QString errmsg = QAptDecorator::errorText(errcode, this->m_txn);
216 kDebug() << "Got an error: " << errmsg;
217
218 KMessageBox::error(
219 NULL,
220 i18nc("@info Error message", "Error updating sources"
221 " after configuring debug sources"),
222 i18nc("@title:window", "Failed updating sources")
223 );
224}
225
226void DebugFinder::onProgressChanged(int progress)
227{
228 kDebug() << "Progress changed to " << progress;
229
230 int presentProgress = progress;
231
232 if (progress >= 100) {
233 presentProgress = 0;
234 }
235 m_progress.progressBar()->setValue(presentProgress);
236}
94237
=== modified file 'src/DebugFinder.h'
--- src/DebugFinder.h 2012-10-30 15:16:47 +0000
+++ src/DebugFinder.h 2013-07-17 00:34:26 +0000
@@ -1,6 +1,7 @@
1/*1/*
2 Copyright © 2010 Harald Sitter <apachelogger@ubuntu.com>2 Copyright © 2010 Harald Sitter <apachelogger@ubuntu.com>
3 Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org>3 Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org>
4 Copyright © 2013 Michael D. Stemle, Jr. <themanchicken@gmail.com>
45
5 This program is free software; you can redistribute it and/or6 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as7 modify it under the terms of the GNU General Public License as
@@ -22,13 +23,25 @@
22#ifndef DEBUGFINDER_H23#ifndef DEBUGFINDER_H
23#define DEBUGFINDER_H24#define DEBUGFINDER_H
2425
26#include <LibQApt/Globals>
27
25#include <QtCore/QObject>28#include <QtCore/QObject>
26#include <QtCore/QStringList>29#include <QtCore/QStringList>
30#include <KProgressDialog>
31
32#define REPO_ARG_BASE "deb http://ddebs.ubuntu.com %1 main restricted universe multiverse"
33#define REPO_ARG_UPDATES "deb http://ddebs.ubuntu.com %1-updates main restricted universe multiverse"
34#define REPO_ARG_SECURITY "deb http://ddebs.ubuntu.com %1-security main restricted universe multiverse"
35#define REPO_ARG_PROPOSED "deb http://ddebs.ubuntu.com %1-proposed main restricted universe multiverse"
36#define DDEB_REPO_FILE "/etc/apt/sources.list.d/ddebs.list"
2737
28namespace QApt {38namespace QApt {
29 class Backend;39 class Backend;
30 class Package;40 class Package;
31}41 class SourceEntry;
42 class SourcesList;
43 class Transaction;
44};
3245
33class DebugFinder : public QObject46class DebugFinder : public QObject
34{47{
@@ -36,18 +49,32 @@
36public:49public:
37 explicit DebugFinder(QObject *parent = 0);50 explicit DebugFinder(QObject *parent = 0);
3851
52 void performUpdate();
53
39public slots:54public slots:
40 void find(const QString &file);55 void startFinding(const QString &file);
56 void find();
41 void stop();57 void stop();
4258 void onTxnStatusChanged(QApt::TransactionStatus status);
59 void onAptError(QApt::ErrorCode errcode);
60 void onUpdateFinished();
61 void onProgressChanged(int progress);
62
43signals:63signals:
44 void foundDbgPkg(const QString &dbgpkg);64 void foundDbgPkg(const QString &dbgpkg);
45 void foundNoDbgPkg(const QString &file);65 void foundNoDbgPkg(const QString &dbgpkg);
46 void alreadyInstalled();66 void alreadyInstalled();
67 void updateFinishing();
4768
48private:69private:
49 QApt::Package *getDbgPkg(QApt::Package *package);70 QApt::Package *getDbgPkg(QApt::Package *package);
50 QApt::Backend *m_backend;71 QApt::Backend *m_backend;
72 QApt::Transaction *m_txn;
73 KProgressDialog m_progress;
74 QString m_file;
75 int m_srcCount;
76 int m_srcUpdated;
77 int m_lastProgress;
5178
52 bool m_stop;79 bool m_stop;
53};80};
5481
=== modified file 'src/DebugInstaller.cpp'
--- src/DebugInstaller.cpp 2011-09-26 13:35:14 +0000
+++ src/DebugInstaller.cpp 2013-07-17 00:34:26 +0000
@@ -1,6 +1,7 @@
1/*1/*
2 Copyright © 2010 Harald Sitter <apachelogger@ubuntu.com>2 Copyright © 2010 Harald Sitter <apachelogger@ubuntu.com>
3 Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org>3 Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org>
4 Copyright © 2013 Michael D. Stemle, Jr. <themanchicken@gmail.com>
45
5 This program is free software; you can redistribute it and/or6 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as7 modify it under the terms of the GNU General Public License as
@@ -163,7 +164,7 @@
163 progressBar()->setMaximum(m_args.count());164 progressBar()->setMaximum(m_args.count());
164 incrementProgress();165 incrementProgress();
165166
166 m_finder = new DebugFinder;167 m_finder = new DebugFinder(this);
167 connect(m_finder, SIGNAL(foundDbgPkg(QString)), this, SLOT(foundDbgPkg(QString)));168 connect(m_finder, SIGNAL(foundDbgPkg(QString)), this, SLOT(foundDbgPkg(QString)));
168 connect(m_finder, SIGNAL(foundNoDbgPkg(QString)), this, SLOT(foundNoDbgPkg(QString)));169 connect(m_finder, SIGNAL(foundNoDbgPkg(QString)), this, SLOT(foundNoDbgPkg(QString)));
169 connect(m_finder, SIGNAL(alreadyInstalled()), this, SLOT(alreadyInstalled()));170 connect(m_finder, SIGNAL(alreadyInstalled()), this, SLOT(alreadyInstalled()));
@@ -173,7 +174,7 @@
173 m_finderThread->start();174 m_finderThread->start();
174175
175 foreach (const QString &file, m_args) {176 foreach (const QString &file, m_args) {
176 QMetaObject::invokeMethod(m_finder, "find", Qt::QueuedConnection,177 QMetaObject::invokeMethod(m_finder, "startFinding", Qt::QueuedConnection,
177 Q_ARG(QString, file));178 Q_ARG(QString, file));
178 }179 }
179}180}
180181
=== added file 'src/LSBRelease.cpp'
--- src/LSBRelease.cpp 1970-01-01 00:00:00 +0000
+++ src/LSBRelease.cpp 2013-07-17 00:34:26 +0000
@@ -0,0 +1,66 @@
1/*
2 Copyright (C) 2012 Harald Sitter <apachelogger@ubuntu.com>
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of
7 the License or (at your option) version 3 or any later version
8 accepted by the membership of KDE e.V. (or its successor approved
9 by the membership of KDE e.V.), which shall act as a proxy
10 defined in Section 14 of version 3 of the license.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#include "LSBRelease.h"
22
23#include <QtCore/QFile>
24
25#include <KDebug>
26#include <KLocalizedString>
27
28LSBRelease::LSBRelease()
29{
30 QFile file("/etc/lsb-release");
31 if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
32 kDebug() << "Could not open /etc/lsb-release, aborting LSB";
33 QString unknown = i18nc("@label", "Unknown");
34 m_id = unknown;
35 m_release = unknown;
36 m_codename = unknown;
37 m_description = unknown;
38 return;
39 }
40
41 // List of valid column identifiers
42 QString line;
43 QStringList comps;
44 while (!file.atEnd()) {
45 line = file.readLine();
46 comps = line.split(QChar('='));
47// #warning unknown set?
48 Q_ASSERT(comps.size() == 2);
49 QString key = comps.at(0);
50 QString value = comps.at(1).trimmed();
51 if (key == QLatin1String("DISTRIB_ID"))
52 m_id = value;
53 else if (key == QLatin1String("DISTRIB_RELEASE"))
54 m_release = value;
55 else if (key == QLatin1String("DISTRIB_CODENAME"))
56 m_codename = value;
57 else if (key == QLatin1String("DISTRIB_DESCRIPTION"))
58 m_description = value;
59 else
60 Q_ASSERT(false); // Should not happen!
61 }
62
63// #warning unknown set?
64 if (m_id.isEmpty() || m_release.isEmpty())
65 Q_ASSERT(false); // meh.
66}
0\ No newline at end of file67\ No newline at end of file
168
=== added file 'src/LSBRelease.h'
--- src/LSBRelease.h 1970-01-01 00:00:00 +0000
+++ src/LSBRelease.h 2013-07-17 00:34:26 +0000
@@ -0,0 +1,43 @@
1/*
2 Copyright (C) 2012 Harald Sitter <apachelogger@ubuntu.com>
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of
7 the License or (at your option) version 3 or any later version
8 accepted by the membership of KDE e.V. (or its successor approved
9 by the membership of KDE e.V.), which shall act as a proxy
10 defined in Section 14 of version 3 of the license.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#ifndef LSBRELEASE_H
22#define LSBRELEASE_H
23
24#include <QtCore/QString>
25
26class LSBRelease
27{
28public:
29 LSBRelease();
30
31 QString id() { return m_id; }
32 QString release() { return m_release; }
33 QString codename() { return m_codename; }
34 QString description() { return m_description; }
35
36private:
37 QString m_id;
38 QString m_release;
39 QString m_codename;
40 QString m_description;
41};
42
43#endif // LSBRELEASE_H
044
=== added file 'src/QAptDecorator.cpp'
--- src/QAptDecorator.cpp 1970-01-01 00:00:00 +0000
+++ src/QAptDecorator.cpp 2013-07-17 00:34:26 +0000
@@ -0,0 +1,80 @@
1/*
2 Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org> (cacheupdate example in QApt)
3 Copyright © 2013 Michael D. Stemle, Jr. <themanchicken@gmail.com>
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3 or any later version
9 accepted by the membership of KDE e.V. (or its successor approved
10 by the membership of KDE e.V.), which shall act as a proxy
11 defined in Section 14 of version 3 of the license.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#include <QtCore/QString>
23
24#include <LibQApt/Globals>
25#include <KLocalizedString>
26#include "QAptDecorator.h"
27
28QString QAptDecorator::errorText(QApt::ErrorCode error, QApt::Transaction *trans)
29{
30 QString text;
31
32 switch (error) {
33 case QApt::InitError:
34 text = i18nc("@label", "The package system could not be initialized, your "
35 "configuration may be broken.");
36 break;
37 case QApt::LockError:
38 text = i18nc("@label",
39 "Another application seems to be using the package "
40 "system at this time. You must close all other package "
41 "managers before you will be able to install or remove "
42 "any packages.");
43 break;
44 case QApt::DiskSpaceError:
45 text = i18nc("@label",
46 "You do not have enough disk space in the directory "
47 "at %1 to continue with this operation.", trans->errorDetails());
48 break;
49 case QApt::FetchError:
50 text = i18nc("@label", "Could not download packages");
51 break;
52 case QApt::CommitError:
53 text = i18nc("@label", "An error occurred while applying changes:");
54 break;
55 case QApt::AuthError:
56 text = i18nc("@label",
57 "This operation cannot continue since proper "
58 "authorization was not provided");
59 break;
60 case QApt::WorkerDisappeared:
61 text = i18nc("@label", "It appears that the QApt worker has either crashed "
62 "or disappeared. Please report a bug to the QApt maintainers");
63 break;
64 case QApt::UntrustedError:
65 text = i18ncp("@label",
66 "The following package has not been verified by its author. "
67 "Downloading untrusted packages has been disallowed "
68 "by your current configuration.",
69 "The following packages have not been verified by "
70 "their authors. "
71 "Downloading untrusted packages has "
72 "been disallowed by your current configuration.",
73 trans->untrustedPackages().size());
74 break;
75 default:
76 break;
77 }
78
79 return text;
80}
0\ No newline at end of file81\ No newline at end of file
182
=== added file 'src/QAptDecorator.h'
--- src/QAptDecorator.h 1970-01-01 00:00:00 +0000
+++ src/QAptDecorator.h 2013-07-17 00:34:26 +0000
@@ -0,0 +1,34 @@
1/*
2 Copyright © 2010 Jonathan Thomas <echidnaman@kubuntu.org> (cacheupdate example in QApt)
3 Copyright © 2013 Michael D. Stemle, Jr. <themanchicken@gmail.com>
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3 or any later version
9 accepted by the membership of KDE e.V. (or its successor approved
10 by the membership of KDE e.V.), which shall act as a proxy
11 defined in Section 14 of version 3 of the license.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#ifndef QAPTDECORATOR_H
23#define QAPTDECORATOR_H
24
25#include <LibQApt/Globals>
26#include <LibQApt/Transaction>
27
28class QAptDecorator
29{
30public:
31 static QString errorText(QApt::ErrorCode error, QApt::Transaction *trans);
32};
33
34#endif // QAPTDECORATOR_H

Subscribers

People subscribed via source and target branches