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
8c9f9f94
Commit
8c9f9f94
authored
Jun 20, 2017
by
Wescoeur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(App): coding style on Single App and move component
parent
71e7e8cb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
36 deletions
+27
-36
CMakeLists.txt
CMakeLists.txt
+5
-6
App.hpp
src/app/App.hpp
+1
-1
SingleApplication.cpp
src/app/single-application/SingleApplication.cpp
+0
-0
SingleApplication.hpp
src/app/single-application/SingleApplication.hpp
+3
-3
SingleApplicationDBus.cpp
src/app/single-application/SingleApplicationDBus.cpp
+8
-16
SingleApplicationDBusPrivate.hpp
src/app/single-application/SingleApplicationDBusPrivate.hpp
+7
-7
SingleApplicationPrivate.hpp
src/app/single-application/SingleApplicationPrivate.hpp
+3
-3
No files found.
CMakeLists.txt
View file @
8c9f9f94
...
...
@@ -77,9 +77,9 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -DQT_QML_DEBUG -DQT_
# ------------------------------------------------------------------------------
set
(
QT5_PACKAGES Core Gui Quick Widgets QuickControls2 Svg LinguistTools Concurrent Network
)
if
(
ENABLE_DBUS
)
list
(
APPEND QT5_PACKAGES DBus
)
endif
()
if
(
ENABLE_DBUS
)
list
(
APPEND QT5_PACKAGES DBus
)
endif
()
set
(
QT5_PACKAGES_OPTIONAL TextToSpeech
)
if
(
LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS
)
...
...
@@ -194,7 +194,6 @@ set(HEADERS
src/components/telephone-numbers/TelephoneNumbersModel.hpp
src/components/timeline/TimelineModel.hpp
src/components/url-handlers/UrlHandlers.hpp
src/externals/single-application/SingleApplication.hpp
src/utils/LinphoneUtils.hpp
src/utils/Utils.hpp
)
...
...
@@ -203,8 +202,8 @@ if(ENABLE_DBUS)
list
(
APPEND SOURCES src/app/single-application/SingleApplicationDBus.cpp
)
list
(
APPEND HEADERS src/app/single-application/SingleApplicationDBusPrivate.hpp
)
else
()
list
(
APPEND SOURCES src/
externals
/single-application/SingleApplication.cpp
)
list
(
APPEND HEADERS src/
externals
/single-application/SingleApplicationPrivate.hpp
)
list
(
APPEND SOURCES src/
app
/single-application/SingleApplication.cpp
)
list
(
APPEND HEADERS src/
app
/single-application/SingleApplicationPrivate.hpp
)
endif
()
set
(
QRC_RESOURCES resources.qrc
)
...
...
src/app/App.hpp
View file @
8c9f9f94
...
...
@@ -28,7 +28,7 @@
#include "../components/notifier/Notifier.hpp"
#include "../components/other/colors/Colors.hpp"
#include "
../externals/
single-application/SingleApplication.hpp"
#include "single-application/SingleApplication.hpp"
#define APP_CODE_RESTART 1000
...
...
src/
externals
/single-application/SingleApplication.cpp
→
src/
app
/single-application/SingleApplication.cpp
View file @
8c9f9f94
File moved
src/
externals
/single-application/SingleApplication.hpp
→
src/
app
/single-application/SingleApplication.hpp
View file @
8c9f9f94
...
...
@@ -22,8 +22,8 @@
// See: https://github.com/itay-grudev/SingleApplication/
#ifndef SINGLE_APPLICATION_H
#define SINGLE_APPLICATION_H
#ifndef SINGLE_APPLICATION_H
_
#define SINGLE_APPLICATION_H
_
#include <QApplication>
#include <QtCore/QtGlobal>
...
...
@@ -123,4 +123,4 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS
(
SingleApplication
::
Options
)
#endif // SINGLE_APPLICATION_H
#endif // SINGLE_APPLICATION_H
_
src/app/single-application/SingleApplicationDBus.cpp
View file @
8c9f9f94
...
...
@@ -26,9 +26,7 @@
#include <QtCore/QByteArray>
#include <QtDBus/QtDBus>
#include "../../utils/Utils.hpp"
#include "../../externals/single-application/SingleApplication.hpp"
#include "SingleApplication.hpp"
#include "SingleApplicationDBusPrivate.hpp"
// =============================================================================
...
...
@@ -36,24 +34,18 @@
const
char
*
SERVICE_NAME
=
"org.linphone.SingleApplication"
;
SingleApplicationPrivate
::
SingleApplicationPrivate
(
SingleApplication
*
q_ptr
)
:
QDBusAbstractAdaptor
(
q_ptr
),
q_ptr
(
q_ptr
)
{
}
SingleApplicationPrivate
::~
SingleApplicationPrivate
()
{
}
:
QDBusAbstractAdaptor
(
q_ptr
),
q_ptr
(
q_ptr
)
{}
QDBusConnection
SingleApplicationPrivate
::
getBus
()
const
{
if
(
options
&
SingleApplication
::
Mode
::
User
)
{
if
(
options
&
SingleApplication
::
Mode
::
User
)
return
QDBusConnection
::
sessionBus
();
}
else
{
return
QDBusConnection
::
systemBus
();
}
return
QDBusConnection
::
systemBus
();
}
void
SingleApplicationPrivate
::
startPrimary
()
{
if
(
getBus
().
registerObject
(
"/"
,
this
,
QDBusConnection
::
ExportAllSlots
)
==
false
)
{
qWarning
()
<<
"Failed to register single application object on DBus"
;
}
if
(
!
getBus
().
registerObject
(
"/"
,
this
,
QDBusConnection
::
ExportAllSlots
))
qWarning
()
<<
QStringLiteral
(
"Failed to register single application object on DBus."
);
instanceNumber
=
0
;
}
...
...
@@ -69,7 +61,7 @@ SingleApplication::SingleApplication (int &argc, char *argv[], bool allowSeconda
d
->
options
=
options
;
if
(
!
d
->
getBus
().
isConnected
())
{
qWarning
()
<<
"Cannot connect to the D-Bus session bus."
;
qWarning
()
<<
QStringLiteral
(
"Cannot connect to the D-Bus session bus."
)
;
delete
d
;
::
exit
(
EXIT_FAILURE
);
}
...
...
src/app/single-application/SingleApplicationDBusPrivate.hpp
View file @
8c9f9f94
...
...
@@ -20,13 +20,13 @@
* Author: Ghislain MARY
*/
#ifndef SINGLE_APPLICATION_DBUS_PRIVATE_H
#define SINGLE_APPLICATION_DBUS_PRIVATE_H
#include "../../externals/single-application/SingleApplication.hpp"
#ifndef SINGLE_APPLICATION_DBUS_PRIVATE_H_
#define SINGLE_APPLICATION_DBUS_PRIVATE_H_
#include <QtDBus/QtDBus>
#include "SingleApplication.hpp"
// =============================================================================
struct
InstancesInfo
{
...
...
@@ -40,7 +40,7 @@ class SingleApplicationPrivate : public QDBusAbstractAdaptor {
public:
Q_DECLARE_PUBLIC
(
SingleApplication
)
SingleApplicationPrivate
(
SingleApplication
*
q_ptr
);
~
SingleApplicationPrivate
();
~
SingleApplicationPrivate
()
=
default
;
QDBusConnection
getBus
()
const
;
...
...
@@ -52,7 +52,7 @@ public:
quint32
instanceNumber
;
public
Q_SLOTS
:
void
messageReceived
(
quint32
instanceId
,
QByteArray
message
);
void
messageReceived
(
quint32
instanceId
,
QByteArray
message
);
};
#endif // SINGLE_APPLICATION_DBUS_PRIVATE_H
#endif // SINGLE_APPLICATION_DBUS_PRIVATE_H
_
src/
externals
/single-application/SingleApplicationPrivate.hpp
→
src/
app
/single-application/SingleApplicationPrivate.hpp
View file @
8c9f9f94
...
...
@@ -29,8 +29,8 @@
// version without notice, or may even be removed.
//
#ifndef SINGLE_APPLICATION_PRIVATE_H
#define SINGLE_APPLICATION_PRIVATE_H
#ifndef SINGLE_APPLICATION_PRIVATE_H
_
#define SINGLE_APPLICATION_PRIVATE_H
_
#include <QtCore/QMutex>
#include <QtCore/QSharedMemory>
...
...
@@ -79,4 +79,4 @@ public Q_SLOTS:
void
slotClientConnectionClosed
(
QLocalSocket
*
,
quint32
);
};
#endif // SINGLE_APPLICATION_PRIVATE_H
#endif // SINGLE_APPLICATION_PRIVATE_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