Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
rws77
ocs-manager
Commits
626d8567
Commit
626d8567
authored
Jan 17, 2019
by
akiraohgaki
Browse files
Merge branch 'develop'
parents
1841b9c2
dcf16063
Changes
15
Hide whitespace changes
Inline
Side-by-side
app/app.pri
View file @
626d8567
...
...
@@ -29,7 +29,7 @@ RESOURCES += $${PWD}/configs/configs.qrc
INCLUDEPATH += $${PWD}/src
unix:!ios:!android
{
contains(DEFINES, APP_DESKTOP)
{
QT += dbus
HEADERS += \
...
...
app/configs/application.json
View file @
626d8567
{
"id"
:
"ocs-manager"
,
"name"
:
"ocs-manager"
,
"version"
:
"0.7.
0
"
,
"version"
:
"0.7.
1
"
,
"organization"
:
"Opendesktop.org"
,
"domain"
:
"org.opendesktop.ocs-manager"
,
"icon"
:
":/desktop/ocs-manager.svg"
,
...
...
app/src/handlers/desktopthemehandler.cpp
View file @
626d8567
...
...
@@ -2,7 +2,7 @@
#include
<QStringList>
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
#include
<QFileInfo>
#include
"desktopthemes/kdetheme.h"
...
...
@@ -98,7 +98,7 @@ bool DesktopThemeHandler::isApplicableType(const QString &installType) const
bool
DesktopThemeHandler
::
applyTheme
(
const
QString
&
path
,
const
QString
&
installType
)
const
{
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
if
(
QFileInfo
::
exists
(
path
)
&&
isApplicableType
(
installType
))
{
auto
desktop
=
desktopEnvironment
();
...
...
app/src/handlers/itemhandler.cpp
View file @
626d8567
...
...
@@ -6,7 +6,7 @@
#include
<QFileInfo>
#include
<QDateTime>
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
#include
<QProcess>
#endif
...
...
@@ -146,10 +146,10 @@ void ItemHandler::uninstall(const QString &itemKey)
auto
installType
=
installedItem
[
"install_type"
].
toString
();
Qtil
::
Dir
destDir
;
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
destDir
.
setPath
(
configHandler_
->
getAppConfigInstallTypes
()[
installType
].
toObject
()[
"destination"
].
toString
());
for
(
const
auto
&
filename
:
installedItem
[
"files"
].
toArray
())
{
for
(
const
auto
filename
:
installedItem
[
"files"
].
toArray
())
{
QFileInfo
fileInfo
(
destDir
.
path
()
+
"/"
+
filename
.
toString
());
// plasmapkg: Installation process has should be saved plasmapkg into destination directory
...
...
@@ -194,7 +194,7 @@ void ItemHandler::uninstall(const QString &itemKey)
#else
destDir
.
setPath
(
configHandler_
->
getAppConfigInstallTypes
()[
installType
].
toObject
()[
"generic_destination"
].
toString
());
for
(
const
auto
&
filename
:
installedItem
[
"files"
].
toArray
())
{
for
(
const
auto
filename
:
installedItem
[
"files"
].
toArray
())
{
QFileInfo
fileInfo
(
destDir
.
path
()
+
"/"
+
filename
.
toString
());
if
(
fileInfo
.
isDir
())
{
Qtil
::
Dir
(
fileInfo
.
filePath
()).
remove
();
...
...
@@ -342,7 +342,7 @@ void ItemHandler::installDownloadedFile(Qtil::NetworkResource *resource)
emit
installStarted
(
result
);
Qtil
::
Dir
destDir
;
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
destDir
.
setPath
(
configHandler_
->
getAppConfigInstallTypes
()[
installType
].
toObject
()[
"destination"
].
toString
());
// plasmapkg: Need to save package to remove installed files later
...
...
app/src/handlers/ocsapihandler.cpp
View file @
626d8567
...
...
@@ -15,7 +15,7 @@ bool OcsApiHandler::addProviders(const QString &providerFileUrl) const
{
auto
providers
=
Qtil
::
OcsApi
::
getProviderFile
(
QUrl
(
providerFileUrl
));
if
(
!
providers
.
isEmpty
())
{
for
(
const
auto
&
providerValue
:
providers
)
{
for
(
const
auto
providerValue
:
providers
)
{
auto
provider
=
providerValue
.
toObject
();
if
(
provider
.
contains
(
"location"
))
{
// Use location (API base URL) as unique key
...
...
@@ -69,7 +69,7 @@ bool OcsApiHandler::updateCategories(const QString &providerKey, bool force) con
// Data type variation workaround, convert object to array
QJsonArray
responseData
;
if
(
response
[
"data"
].
isObject
())
{
for
(
const
auto
&
dataValue
:
response
[
"data"
].
toObject
())
{
for
(
const
auto
dataValue
:
response
[
"data"
].
toObject
())
{
responseData
.
append
(
dataValue
);
}
}
...
...
@@ -86,7 +86,7 @@ bool OcsApiHandler::updateCategories(const QString &providerKey, bool force) con
}
QJsonObject
newProviderCategories
;
for
(
const
auto
&
dataValue
:
responseData
)
{
for
(
const
auto
dataValue
:
responseData
)
{
auto
data
=
dataValue
.
toObject
();
// Data type variation workaround, convert int to string
...
...
app/src/handlers/systemhandler.cpp
View file @
626d8567
...
...
@@ -3,7 +3,7 @@
#include
<QUrl>
#include
<QDesktopServices>
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
#include
<QFileInfo>
#include
<QProcess>
#endif
...
...
@@ -16,14 +16,6 @@ SystemHandler::SystemHandler(QObject *parent)
:
QObject
(
parent
)
{}
bool
SystemHandler
::
isUnix
()
const
{
#ifdef QTIL_OS_UNIX
return
true
;
#endif
return
false
;
}
bool
SystemHandler
::
isMobileDevice
()
const
{
#if defined(APP_MOBILE)
...
...
@@ -42,7 +34,7 @@ bool SystemHandler::openUrl(const QString &url) const
path
.
replace
(
"file://localhost"
,
""
,
Qt
::
CaseInsensitive
);
path
.
replace
(
"file://"
,
""
,
Qt
::
CaseInsensitive
);
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
if
((
path
.
endsWith
(
".appimage"
,
Qt
::
CaseInsensitive
)
||
path
.
endsWith
(
".exe"
,
Qt
::
CaseInsensitive
))
&&
QFileInfo
(
path
).
isExecutable
())
{
return
QProcess
::
startDetached
(
path
);
...
...
app/src/handlers/systemhandler.h
View file @
626d8567
...
...
@@ -10,7 +10,6 @@ public:
explicit
SystemHandler
(
QObject
*
parent
=
nullptr
);
public
slots
:
bool
isUnix
()
const
;
bool
isMobileDevice
()
const
;
bool
openUrl
(
const
QString
&
url
)
const
;
};
app/src/handlers/updatehandler.cpp
View file @
626d8567
...
...
@@ -9,7 +9,7 @@
#include
"handlers/confighandler.h"
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
#include
"updaters/appimageupdater.h"
#endif
...
...
@@ -38,7 +38,7 @@ void UpdateHandler::checkAll()
auto
installType
=
installedItem
[
"install_type"
].
toString
();
QString
filePath
=
""
;
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
filePath
=
configHandler_
->
getAppConfigInstallTypes
()[
installType
].
toObject
()[
"destination"
].
toString
()
+
"/"
+
filename
;
#else
filePath
=
configHandler_
->
getAppConfigInstallTypes
()[
installType
].
toObject
()[
"generic_destination"
].
toString
()
+
"/"
+
filename
;
...
...
@@ -47,7 +47,7 @@ void UpdateHandler::checkAll()
QString
updateMethod
=
""
;
if
(
installType
==
"bin"
)
{
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
if
(
filePath
.
endsWith
(
".appimage"
,
Qt
::
CaseInsensitive
))
{
if
(
AppImageUpdater
(
itemKey
,
filePath
).
checkForChanges
())
{
updateMethod
=
"appimageupdate"
;
...
...
@@ -86,7 +86,7 @@ void UpdateHandler::update(const QString &itemKey)
auto
updateMethod
=
updateAvailableItems
[
itemKey
].
toObject
()[
"update_method"
].
toString
();
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
if
(
updateMethod
==
"appimageupdate"
)
{
updateAppImage
(
itemKey
);
}
...
...
@@ -96,7 +96,7 @@ void UpdateHandler::update(const QString &itemKey)
#endif
}
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
void
UpdateHandler
::
appImageUpdaterFinished
(
AppImageUpdater
*
updater
)
{
auto
itemKey
=
updater
->
id
();
...
...
@@ -134,7 +134,7 @@ void UpdateHandler::appImageUpdaterFinished(AppImageUpdater *updater)
}
#endif
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
void
UpdateHandler
::
updateAppImage
(
const
QString
&
itemKey
)
{
auto
updateAvailableItem
=
configHandler_
->
getUsrConfigUpdateAvailableItems
()[
itemKey
].
toObject
();
...
...
app/src/handlers/updatehandler.h
View file @
626d8567
...
...
@@ -5,7 +5,7 @@
class
ConfigHandler
;
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
class
AppImageUpdater
;
#endif
...
...
@@ -28,12 +28,12 @@ public slots:
void
update
(
const
QString
&
itemKey
);
private
slots
:
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
void
appImageUpdaterFinished
(
AppImageUpdater
*
updater
);
#endif
private:
#ifdef
QTIL_OS_UNIX
#ifdef
APP_DESKTOP
void
updateAppImage
(
const
QString
&
itemKey
);
#endif
...
...
app/src/main.cpp
View file @
626d8567
...
...
@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
clParser
.
process
(
app
);
auto
port
=
clParser
.
value
(
clOptionPort
).
to
In
t
();
auto
port
=
clParser
.
value
(
clOptionPort
).
to
UShor
t
();
// Setup websocket server
auto
*
wsServer
=
new
WebSocketServer
(
configHandler
,
appConfigApplication
[
"id"
].
toString
(),
port
,
&
app
);
...
...
app/src/websockets/websocketserver.cpp
View file @
626d8567
...
...
@@ -335,9 +335,6 @@ void WebSocketServer::receiveMessage(const QString &id, const QString &func, con
resultData
.
append
(
configHandler_
->
removeUsrConfigUpdateAvailableItemsItem
(
data
.
at
(
0
).
toString
()));
}
// SystemHandler
else
if
(
func
==
"SystemHandler::isUnix"
)
{
resultData
.
append
(
systemHandler_
->
isUnix
());
}
else
if
(
func
==
"SystemHandler::isMobileDevice"
)
{
resultData
.
append
(
systemHandler_
->
isMobileDevice
());
}
...
...
deployment.pri
View file @
626d8567
unix:!ios:!android
{
contains(DEFINES, APP_DESKTOP)
{
isEmpty(PREFIX) {
PREFIX = /usr/local
}
...
...
lib/lib.pri
View file @
626d8567
include($${PWD}/qtil/qtil.pri)
unix:!ios:!android
{
contains(DEFINES, APP_DESKTOP)
{
INCLUDEPATH += $${PWD}/AppImageUpdate/include
DEPENDPATH += $${PWD}/AppImageUpdate/include
...
...
ocs-manager.pro
View file @
626d8567
ios
|
android
|!
isEmpty
(
APP_MOBILE
)
{
DEFINES
+=
APP_MOBILE
}
else
{
}
else
:
unix
:
!
macx
{
DEFINES
+=
APP_DESKTOP
}
...
...
pkg/appimage/appimagebuild
View file @
626d8567
#!/bin/bash
PKGNAME
=
'ocs-manager'
PKGVER
=
'0.7.
0
'
PKGVER
=
'0.7.
1
'
PKGREL
=
'1'
#UPDINFO='zsync|http://***/ocs-manager-x86_64.AppImage.zsync'
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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