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
03bf26aa
Commit
03bf26aa
authored
Apr 02, 2011
by
Lukas Appelhans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-Qd is done
parent
e4d144b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
8 deletions
+38
-8
apm.cpp
apm.cpp
+0
-8
queryoperation.cpp
queryoperation.cpp
+36
-0
queryoperation.h
queryoperation.h
+2
-0
No files found.
apm.cpp
View file @
03bf26aa
...
...
@@ -48,14 +48,6 @@ void APM::start()
QueryOperation
*
query
=
new
QueryOperation
(
this
);
query
->
start
(
m_operations
,
m_args
);
}
QTextStream
out
(
stdout
);
//out << endl;
out
<<
"blub"
;
out
<<
endl
;
out
.
flush
();
kDebug
()
<<
"Start"
;
printf
(
"Start
\n
"
);
kDebug
()
<<
"Type"
<<
m_operationType
<<
"Operations"
<<
m_operations
<<
"Args"
<<
m_args
;
}
#include "apm.moc"
queryoperation.cpp
View file @
03bf26aa
...
...
@@ -12,9 +12,11 @@
#include <akabeibackend.h>
#include <akabeigroup.h>
#include <akabeidatabase.h>
#include <klocale.h>
#include <QTextStream>
#include <kio/global.h>
#include <kdebug.h>
#include <QDate>
QueryOperation
::
QueryOperation
(
QObject
*
parent
)
...
...
@@ -42,6 +44,18 @@ void QueryOperation::start(QList<APM::Operation> operations, QStringList args)
connect
(
Akabei
::
Backend
::
instance
(),
SIGNAL
(
queryGroupsCompleted
(
QUuid
,
QList
<
Akabei
::
Group
*>
)),
SLOT
(
showGroup
(
QUuid
,
QList
<
Akabei
::
Group
*>
)));
Akabei
::
Backend
::
instance
()
->
queryGroups
(
"SELECT * FROM groups WHERE Name LIKE
\"
"
+
args
.
first
()
+
"
\"
"
);
}
else
if
(
operations
.
contains
(
APM
::
ShowChangelog
))
{
if
(
args
.
isEmpty
())
return
;
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
))
{
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);
showInstalledAsDeps
(
Akabei
::
Backend
::
instance
()
->
localDatabase
()
->
queryPackages
(
query
));
}
}
...
...
@@ -93,3 +107,25 @@ void QueryOperation::showGroup(QUuid uuid,QList<Akabei::Group*> groups)
out
<<
group
->
name
()
<<
' '
<<
pkg
->
name
()
<<
endl
;
out
.
flush
();
}
void
QueryOperation
::
showChangelog
(
QUuid
uuid
,
QList
<
Akabei
::
Package
*
>
packages
)
{
Q_UNUSED
(
uuid
)
if
(
packages
.
isEmpty
())
return
;
Akabei
::
Package
*
pkg
=
packages
.
first
();
QTextStream
out
(
stdout
);
out
<<
pkg
->
retrieveChangelog
()
<<
endl
;
out
.
flush
();
}
void
QueryOperation
::
showInstalledAsDeps
(
QList
<
Akabei
::
Package
*>
packages
)
{
if
(
packages
.
isEmpty
())
return
;
QTextStream
out
(
stdout
);
foreach
(
Akabei
::
Package
*
pkg
,
packages
)
out
<<
pkg
->
name
()
<<
' '
<<
pkg
->
version
().
toByteArray
().
data
()
<<
endl
;
out
.
flush
();
}
queryoperation.h
View file @
03bf26aa
...
...
@@ -29,6 +29,8 @@ public:
private
slots
:
void
showInformation
(
QUuid
uuid
,
QList
<
Akabei
::
Package
*>
packages
);
void
showGroup
(
QUuid
uuid
,
QList
<
Akabei
::
Group
*>
groups
);
void
showChangelog
(
QUuid
uuid
,
QList
<
Akabei
::
Package
*>
packages
);
void
showInstalledAsDeps
(
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