Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
b9353adc
Commit
b9353adc
authored
Jun 15, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(App): check update at startup
parent
93f91b42
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
23 deletions
+25
-23
App.cpp
src/app/App.cpp
+22
-6
App.hpp
src/app/App.hpp
+2
-1
CoreHandlers.cpp
src/components/core/CoreHandlers.cpp
+0
-15
main.cpp
src/main.cpp
+1
-1
No files found.
src/app/App.cpp
View file @
b9353adc
...
...
@@ -29,6 +29,8 @@
#include <QtDebug>
#include <QTimer>
#include "config.h"
#include "../components/Components.hpp"
#include "../utils/Utils.hpp"
...
...
@@ -55,6 +57,8 @@
#define SELF_TEST_DELAY 300000
#define VERSION_UPDATE_CHECK_INTERVAL 86400000 // 24 hours in milliseconds.
using
namespace
std
;
// =============================================================================
...
...
@@ -256,12 +260,6 @@ void App::smartShowWindow (QQuickWindow *window) {
window
->
requestActivate
();
}
void
App
::
checkForUpdate
()
{
CoreManager
::
getInstance
()
->
getCore
()
->
checkForUpdate
(
::
Utils
::
appStringToCoreString
(
applicationVersion
())
);
}
// -----------------------------------------------------------------------------
bool
App
::
hasFocus
()
const
{
...
...
@@ -528,6 +526,24 @@ void App::openAppAfterInit () {
if
(
!
commandArgument
.
isEmpty
())
executeCommand
(
commandArgument
);
}
#ifdef ENABLE_UPDATE_CHECK
QTimer
*
timer
=
new
QTimer
(
mEngine
);
timer
->
setInterval
(
VERSION_UPDATE_CHECK_INTERVAL
);
QObject
::
connect
(
timer
,
&
QTimer
::
timeout
,
this
,
&
App
::
checkForUpdate
);
timer
->
start
();
checkForUpdate
();
#endif // ifdef ENABLE_UPDATE_CHECK
}
// -----------------------------------------------------------------------------
void
App
::
checkForUpdate
()
{
CoreManager
::
getInstance
()
->
getCore
()
->
checkForUpdate
(
::
Utils
::
appStringToCoreString
(
applicationVersion
())
);
}
// -----------------------------------------------------------------------------
...
...
src/app/App.hpp
View file @
b9353adc
...
...
@@ -78,7 +78,6 @@ public:
Q_INVOKABLE
QQuickWindow
*
getSettingsWindow
();
Q_INVOKABLE
static
void
smartShowWindow
(
QQuickWindow
*
window
);
Q_INVOKABLE
static
void
checkForUpdate
();
public
slots
:
void
quit
();
...
...
@@ -109,6 +108,8 @@ private:
void
openAppAfterInit
();
static
void
checkForUpdate
();
static
QString
getQtVersion
()
{
return
qVersion
();
}
...
...
src/components/core/CoreHandlers.cpp
View file @
b9353adc
...
...
@@ -31,11 +31,6 @@
#include "CoreHandlers.hpp"
#include "config.h"
#define VERSION_UPDATE_CHECK_OBJECT_NAME "version-update-check-timer"
#define VERSION_UPDATE_CHECK_INTERVAL 86400000
/* 24 hours in milliseconds. */
using
namespace
std
;
// =============================================================================
...
...
@@ -78,16 +73,6 @@ void CoreHandlers::notifyCoreStarted () {
[
this
]()
{
qInfo
()
<<
QStringLiteral
(
"Core started."
);
emit
coreStarted
();
#ifdef ENABLE_UPDATE_CHECK
QTimer
*
timer
=
new
QTimer
(
this
);
timer
->
setInterval
(
VERSION_UPDATE_CHECK_INTERVAL
);
QObject
::
connect
(
timer
,
&
QTimer
::
timeout
,
this
,
&
App
::
checkForUpdate
);
timer
->
start
();
App
::
checkForUpdate
();
#endif // ifdef ENABLE_UPDATE_CHECK
});
}
...
...
src/main.cpp
View file @
b9353adc
...
...
@@ -28,7 +28,7 @@
#include "app/App.hpp"
// Must be unique. Used by `SingleApplication`.
// Must be unique. Used by `SingleApplication`
and `Paths`
.
#define APPLICATION_NAME "linphone"
#define APPLICATION_VERSION LINPHONE_QT_GIT_VERSION
...
...
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