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
2df59f19
You need to sign in or sign up before continuing.
Commit
2df59f19
authored
Dec 19, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(app): coding style
parent
7a3d0f2c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
49 additions
and
43 deletions
+49
-43
App.cpp
tests/src/app/App.cpp
+1
-1
App.hpp
tests/src/app/App.hpp
+1
-1
AvatarProvider.cpp
tests/src/app/AvatarProvider.cpp
+1
-3
AvatarProvider.hpp
tests/src/app/AvatarProvider.hpp
+2
-1
Database.cpp
tests/src/app/Database.cpp
+9
-9
Database.hpp
tests/src/app/Database.hpp
+2
-2
DefaultTranslator.cpp
tests/src/app/DefaultTranslator.cpp
+1
-1
DefaultTranslator.hpp
tests/src/app/DefaultTranslator.hpp
+2
-2
Logger.cpp
tests/src/app/Logger.cpp
+28
-23
Logger.hpp
tests/src/app/Logger.hpp
+2
-0
No files found.
tests/src/app/App.cpp
View file @
2df59f19
...
...
@@ -58,7 +58,7 @@ App::App (int &argc, char **argv) : QApplication(argc, argv) {
m_engine
.
addImportPath
(
":/ui/views"
);
}
// -------------------------------------------------------------------
// -------------------------------------------------------------------
----------
void
App
::
initContentApp
()
{
qInfo
()
<<
"Initializing core manager..."
;
...
...
tests/src/app/App.hpp
View file @
2df59f19
...
...
@@ -11,7 +11,7 @@
class
Notifier
;
// ===================================================================
// ===================================================================
==========
class
App
:
public
QApplication
{
Q_OBJECT
;
...
...
tests/src/app/AvatarProvider.cpp
View file @
2df59f19
#include <QtDebug>
#include "Database.hpp"
#include "../utils.hpp"
#include "AvatarProvider.hpp"
// ===================================================================
// ===================================================================
==========
const
QString
AvatarProvider
::
PROVIDER_ID
=
"avatar"
;
...
...
tests/src/app/AvatarProvider.hpp
View file @
2df59f19
...
...
@@ -3,7 +3,7 @@
#include <QQuickImageProvider>
// ===================================================================
// ===================================================================
==========
class
AvatarProvider
:
public
QQuickImageProvider
{
public:
...
...
@@ -17,6 +17,7 @@ public:
)
override
;
static
const
QString
PROVIDER_ID
;
private:
QString
m_avatars_path
;
};
...
...
tests/src/app/Database.cpp
View file @
2df59f19
...
...
@@ -7,12 +7,12 @@
#include "Database.hpp"
#ifdef _WIN32
#define DATABASES_PATH \
QStandardPaths::writableLocation(QStandardPaths::DataLocation)
#define DATABASES_PATH \
QStandardPaths::writableLocation(QStandardPaths::DataLocation)
#else
#define DATABASES_PATH \
QStandardPaths::writableLocation(QStandardPaths::HomeLocation)
#endif
#define DATABASES_PATH \
QStandardPaths::writableLocation(QStandardPaths::HomeLocation)
#endif
// ifdef _WIN32
#define DATABASE_PATH_AVATARS ".linphone/avatars/"
#define DATABASE_PATH_CALL_HISTORY_LIST ".linphone-call-history.db"
...
...
@@ -21,7 +21,7 @@
using
namespace
std
;
// ===================================================================
// ===================================================================
==========
inline
bool
ensureDatabaseFilePathExists
(
const
QString
&
path
)
{
QDir
dir
(
DATABASES_PATH
);
...
...
@@ -47,9 +47,9 @@ string Database::getAvatarsPath () {
inline
string
getDatabaseFilePath
(
const
QString
&
filename
)
{
QString
path
(
DATABASES_PATH
+
"/"
);
path
+=
filename
;
return
ensureDatabaseFilePathExists
(
path
)
?
Utils
::
qStringToLinphoneString
(
QDir
::
toNativeSeparators
(
path
)
)
:
""
;
return
ensureDatabaseFilePathExists
(
path
)
?
Utils
::
qStringToLinphoneString
(
QDir
::
toNativeSeparators
(
path
)
)
:
""
;
}
string
Database
::
getCallHistoryPath
()
{
...
...
tests/src/app/Database.hpp
View file @
2df59f19
...
...
@@ -3,7 +3,7 @@
#include <string>
// ===================================================================
// ===================================================================
==========
namespace
Database
{
// Returns the databases paths.
...
...
@@ -14,6 +14,6 @@ namespace Database {
std
::
string
getCallHistoryPath
();
std
::
string
getFriendsListPath
();
std
::
string
getMessageHistoryPath
();
}
;
}
#endif // DATABASE_H_
tests/src/app/DefaultTranslator.cpp
View file @
2df59f19
...
...
@@ -3,7 +3,7 @@
#include "DefaultTranslator.hpp"
// ===================================================================
// ===================================================================
==========
DefaultTranslator
::
DefaultTranslator
()
{
QDirIterator
it
(
":"
,
QDirIterator
::
Subdirectories
);
...
...
tests/src/app/DefaultTranslator.hpp
View file @
2df59f19
...
...
@@ -4,7 +4,7 @@
#include <QSet>
#include <QTranslator>
// ===================================================================
// ===================================================================
==========
class
DefaultTranslator
:
public
QTranslator
{
public:
...
...
@@ -22,4 +22,4 @@ private:
QSet
<
QString
>
m_contexts
;
};
#endif
#endif
// DEFAULT_TRANSLATOR_H_
tests/src/app/Logger.cpp
View file @
2df59f19
...
...
@@ -14,9 +14,9 @@
#define PURPLE ""
#define RED ""
#define RESET ""
#endif
#endif
// ifdef __linux__
// ===================================================================
// ===================================================================
==========
void
logger
(
QtMsgType
type
,
const
QMessageLogContext
&
context
,
const
QString
&
msg
)
{
QByteArray
local_msg
=
msg
.
toLocal8Bit
();
...
...
@@ -31,26 +31,31 @@ void logger (QtMsgType type, const QMessageLogContext &context, const QString &m
context_line
=
context
.
line
;
}
switch
(
type
)
{
case
QtDebugMsg
:
fprintf
(
stderr
,
GREEN
"[%s][Debug]"
PURPLE
"%s:%u: "
RESET
"%s
\n
"
,
date_time
.
constData
(),
context_file
,
context_line
,
local_msg
.
constData
());
break
;
case
QtInfoMsg
:
fprintf
(
stderr
,
BLUE
"[%s][Info]"
PURPLE
"%s:%u: "
RESET
"%s
\n
"
,
date_time
.
constData
(),
context_file
,
context_line
,
local_msg
.
constData
());
break
;
case
QtWarningMsg
:
fprintf
(
stderr
,
RED
"[%s][Warning]"
PURPLE
"%s:%u: "
RESET
"%s
\n
"
,
date_time
.
constData
(),
context_file
,
context_line
,
local_msg
.
constData
());
break
;
case
QtCriticalMsg
:
fprintf
(
stderr
,
RED
"[%s][Critical]"
PURPLE
"%s:%u: "
RESET
"%s
\n
"
,
date_time
.
constData
(),
context_file
,
context_line
,
local_msg
.
constData
());
break
;
case
QtFatalMsg
:
fprintf
(
stderr
,
RED
"[%s][Fatal]"
PURPLE
"%s:%u: "
RESET
"%s
\n
"
,
date_time
.
constData
(),
context_file
,
context_line
,
local_msg
.
constData
());
abort
();
if
(
type
==
QtDebugMsg
)
fprintf
(
stderr
,
GREEN
"[%s][Debug]"
PURPLE
"%s:%u: "
RESET
"%s
\n
"
,
date_time
.
constData
(),
context_file
,
context_line
,
local_msg
.
constData
()
);
else
if
(
type
==
QtInfoMsg
)
fprintf
(
stderr
,
BLUE
"[%s][Info]"
PURPLE
"%s:%u: "
RESET
"%s
\n
"
,
date_time
.
constData
(),
context_file
,
context_line
,
local_msg
.
constData
()
);
else
if
(
type
==
QtWarningMsg
)
fprintf
(
stderr
,
RED
"[%s][Warning]"
PURPLE
"%s:%u: "
RESET
"%s
\n
"
,
date_time
.
constData
(),
context_file
,
context_line
,
local_msg
.
constData
()
);
else
if
(
type
==
QtCriticalMsg
)
fprintf
(
stderr
,
RED
"[%s][Critical]"
PURPLE
"%s:%u: "
RESET
"%s
\n
"
,
date_time
.
constData
(),
context_file
,
context_line
,
local_msg
.
constData
()
);
else
if
(
type
==
QtFatalMsg
)
{
fprintf
(
stderr
,
RED
"[%s][Fatal]"
PURPLE
"%s:%u: "
RESET
"%s
\n
"
,
date_time
.
constData
(),
context_file
,
context_line
,
local_msg
.
constData
()
);
abort
();
}
}
tests/src/app/Logger.hpp
View file @
2df59f19
...
...
@@ -3,6 +3,8 @@
#include <QtGlobal>
// =============================================================================
void
logger
(
QtMsgType
type
,
const
QMessageLogContext
&
context
,
const
QString
&
msg
);
#endif // LOGGER_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