Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Chakra
Akabei
Akabei frontend
Commits
f945fb39
Commit
f945fb39
authored
Apr 02, 2011
by
Lukas Appelhans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-Qk done
parent
a277f06a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
queryoperation.cpp
queryoperation.cpp
+25
-0
queryoperation.h
queryoperation.h
+1
-0
No files found.
queryoperation.cpp
View file @
f945fb39
...
...
@@ -13,11 +13,14 @@
#include <akabeibackend.h>
#include <akabeigroup.h>
#include <akabeidatabase.h>
#include <akabeiconfig.h>
#include <klocale.h>
#include <QTextStream>
#include <kio/global.h>
#include <kdebug.h>
#include <QDate>
#include <QFile>
#include <QDir>
QueryOperation
::
QueryOperation
(
QObject
*
parent
)
:
QObject
(
parent
)
...
...
@@ -59,6 +62,12 @@ void QueryOperation::start(QList<APM::Operation> operations, QStringList args)
else
query
=
query
+
" InstallReason LIKE 1"
;
showInstalledAsDeps
(
Akabei
::
Backend
::
instance
()
->
localDatabase
()
->
queryPackages
(
query
));
}
else
if
(
operations
.
contains
(
APM
::
CheckFiles
))
{
if
(
args
.
isEmpty
())
return
;
connect
(
Akabei
::
Backend
::
instance
(),
SIGNAL
(
queryPackagesCompleted
(
QUuid
,
QList
<
Akabei
::
Package
*>
)),
SLOT
(
checkFiles
(
QUuid
,
QList
<
Akabei
::
Package
*>
)));
Akabei
::
Backend
::
instance
()
->
searchPackages
(
args
.
first
());
}
}
...
...
@@ -135,3 +144,19 @@ void QueryOperation::showInstalledAsDeps(QList<Akabei::Package*> packages)
out
.
flush
();
}
void
QueryOperation
::
checkFiles
(
QUuid
,
QList
<
Akabei
::
Package
*>
packages
)
{
if
(
packages
.
isEmpty
())
return
;
Akabei
::
Package
*
pkg
=
packages
.
first
();
QTextStream
out
(
stdout
);
int
all
=
0
;
int
missing
=
0
;
foreach
(
const
QString
&
file
,
pkg
->
retrieveFiles
())
{
all
++
;
if
(
!
QFile
::
exists
(
Akabei
::
Config
::
instance
()
->
rootDir
().
absoluteFilePath
(
file
)))
missing
++
;
}
out
<<
pkg
->
name
()
<<
": "
<<
all
<<
" overall files, "
<<
missing
<<
" file(s) missing"
<<
endl
;
}
queryoperation.h
View file @
f945fb39
...
...
@@ -31,6 +31,7 @@ private slots:
void
showGroup
(
QUuid
uuid
,
QList
<
Akabei
::
Group
*>
groups
);
void
showChangelog
(
QUuid
uuid
,
QList
<
Akabei
::
Package
*>
packages
);
void
showInstalledAsDeps
(
QList
<
Akabei
::
Package
*>
);
void
checkFiles
(
QUuid
,
QList
<
Akabei
::
Package
*>
);
};
#endif // QUERYOPERATION_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment