Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Akabei frontend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chakra
Akabei
Akabei frontend
Commits
3dfb1265
Commit
3dfb1265
authored
Apr 11, 2011
by
Lukas Appelhans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating databases yay!
parent
dd4be7a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
syncoperation.cpp
syncoperation.cpp
+52
-0
syncoperation.h
syncoperation.h
+7
-0
No files found.
syncoperation.cpp
View file @
3dfb1265
...
...
@@ -55,6 +55,14 @@ void SyncOperation::start(QList<APM::Operation> operations, QMultiHash<APM::Oper
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
::
UpdateDatabases
))
{
foreach
(
AkabeiClient
::
DatabaseHandler
*
db
,
AkabeiClient
::
Backend
::
instance
()
->
databases
())
{
m_databases
[
db
]
=
false
;
connect
(
db
,
SIGNAL
(
statusChanged
(
AkabeiClient
::
DatabaseHandler
::
Status
)),
SLOT
(
databaseStatusChanged
(
AkabeiClient
::
DatabaseHandler
::
Status
)));
connect
(
db
,
SIGNAL
(
progress
(
int
)),
SLOT
(
databaseProgressChanged
(
int
)));
connect
(
db
,
SIGNAL
(
errorTriggered
(
int
)),
SLOT
(
databaseErrorTriggered
(
int
)));
}
AkabeiClient
::
Backend
::
instance
()
->
updateDatabase
();
}
}
...
...
@@ -176,3 +184,47 @@ void SyncOperation::showGroup(QUuid uuid,QList<Akabei::Group*> groups)
out
.
flush
();
}
void
SyncOperation
::
databaseErrorTriggered
(
int
error
)
{
}
void
SyncOperation
::
databaseProgressChanged
(
int
progress
)
{
QTextStream
out
(
stdout
);
out
<<
static_cast
<
AkabeiClient
::
DatabaseHandler
*>
(
QObject
::
sender
())
->
name
();
out
<<
" ["
;
for
(
int
i
=
1
;
i
!=
11
;
i
++
)
{
if
(
progress
/
i
>=
10
)
{
out
<<
"#"
;
}
else
{
out
<<
"-"
;
}
}
out
<<
"] "
<<
progress
<<
"%"
;
if
(
progress
==
100
)
{
out
<<
endl
;
}
else
{
out
<<
"
\r
"
;
}
out
.
flush
();
}
void
SyncOperation
::
databaseStatusChanged
(
AkabeiClient
::
DatabaseHandler
::
Status
status
)
{
if
(
status
==
AkabeiClient
::
DatabaseHandler
::
StatusFinished
)
m_databases
[
static_cast
<
AkabeiClient
::
DatabaseHandler
*>
(
QObject
::
sender
())]
=
true
;
foreach
(
bool
done
,
m_databases
.
values
())
{
if
(
!
done
)
return
;
}
foreach
(
AkabeiClient
::
DatabaseHandler
*
db
,
AkabeiClient
::
Backend
::
instance
()
->
databases
())
{
disconnect
(
db
,
SIGNAL
(
statusChanged
(
AkabeiClient
::
DatabaseHandler
::
Status
)),
this
,
SLOT
(
databaseStatusChanged
(
AkabeiClient
::
DatabaseHandler
::
Status
)));
disconnect
(
db
,
SIGNAL
(
progress
(
int
)),
this
,
SLOT
(
databaseProgressChanged
(
int
)));
disconnect
(
db
,
SIGNAL
(
errorTriggered
(
int
)),
this
,
SLOT
(
databaseErrorTriggered
(
int
)));
}
m_databases
.
clear
();
QTextStream
out
(
stdout
);
out
<<
tr
(
"Updating all databases finished"
)
<<
endl
;
}
syncoperation.h
View file @
3dfb1265
...
...
@@ -14,6 +14,7 @@
#include <QObject>
#include <QUuid>
#include "apm.h"
#include <akabeiclient/akabeidatabasehandler.h>
class
SyncOperation
:
public
QObject
{
...
...
@@ -29,6 +30,12 @@ private slots:
void
listRepo
(
const
QString
&
repo
);
void
showInformation
(
QUuid
,
QList
<
Akabei
::
Package
*>
packages
);
void
showGroup
(
QUuid
,
QList
<
Akabei
::
Group
*>
);
void
databaseStatusChanged
(
AkabeiClient
::
DatabaseHandler
::
Status
);
void
databaseProgressChanged
(
int
);
void
databaseErrorTriggered
(
int
);
private:
QMap
<
AkabeiClient
::
DatabaseHandler
*
,
bool
>
m_databases
;
};
#endif // SYNCOPERATION_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