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
a277f06a
Commit
a277f06a
authored
Apr 02, 2011
by
Lukas Appelhans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-Qe done and even with sorting!
parent
03bf26aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
queryoperation.cpp
queryoperation.cpp
+8
-2
No files found.
queryoperation.cpp
View file @
a277f06a
...
...
@@ -50,11 +50,14 @@ void QueryOperation::start(QList<APM::Operation> operations, QStringList args)
connect
(
Akabei
::
Backend
::
instance
(),
SIGNAL
(
queryPackagesCompleted
(
QUuid
,
QList
<
Akabei
::
Package
*>
)),
SLOT
(
showChangelog
(
QUuid
,
QList
<
Akabei
::
Package
*>
)));
Akabei
::
Backend
::
instance
()
->
searchPackages
(
args
.
first
());
}
else
if
(
operations
.
contains
(
APM
::
ShowInstalledAsDeps
))
{
}
else
if
(
operations
.
contains
(
APM
::
ShowInstalledAsDeps
)
||
operations
.
contains
(
APM
::
ShowInstalledExplicitely
)
)
{
QString
query
=
"SELECT * FROM packages WHERE"
;
if
(
!
args
.
isEmpty
())
query
=
query
+
" Name LIKE
\"
"
+
args
.
first
()
+
"
\"
AND"
;
query
=
query
+
" InstallReason LIKE 1"
;
// + QString((int)Akabei::Package::InstalledAsDependencyReason);
if
(
operations
.
contains
(
APM
::
ShowInstalledAsDeps
))
query
=
query
+
" InstallReason LIKE 0"
;
// + QString((int)Akabei::Package::InstalledAsDependencyReason);
else
query
=
query
+
" InstallReason LIKE 1"
;
showInstalledAsDeps
(
Akabei
::
Backend
::
instance
()
->
localDatabase
()
->
queryPackages
(
query
));
}
}
...
...
@@ -124,7 +127,10 @@ void QueryOperation::showInstalledAsDeps(QList<Akabei::Package*> packages)
if
(
packages
.
isEmpty
())
return
;
QTextStream
out
(
stdout
);
QMap
<
QString
,
Akabei
::
Package
*>
sorted
;
foreach
(
Akabei
::
Package
*
pkg
,
packages
)
sorted
[
pkg
->
name
()]
=
pkg
;
foreach
(
Akabei
::
Package
*
pkg
,
sorted
.
values
())
out
<<
pkg
->
name
()
<<
' '
<<
pkg
->
version
().
toByteArray
().
data
()
<<
endl
;
out
.
flush
();
}
...
...
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