Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Maui
Communicator
Commits
b8d91936
Commit
b8d91936
authored
Oct 19, 2020
by
Camilo Higuita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update to using i18n and kaboutdata
parent
46880457
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
85 additions
and
89 deletions
+85
-89
CMakeLists.txt
CMakeLists.txt
+16
-18
communicator.pro
communicator.pro
+0
-0
org.maui.communicator.desktop
org.maui.communicator.desktop
+0
-0
org.maui.communicator.json
org.maui.communicator.json
+0
-0
src/main.cpp
src/main.cpp
+68
-48
src/main.qml
src/main.qml
+1
-3
src/union.h
src/union.h
+0
-20
No files found.
CMakeLists.txt
View file @
b8d91936
cmake_minimum_required
(
VERSION 3.1
)
set
(
CO
NTACTS
_VERSION 1.0.0
)
project
(
co
ntacts
LANGUAGES CXX VERSION
${
CO
NTACTS
_VERSION
}
)
set
(
CO
MMUNICATOR
_VERSION 1.0.0
)
project
(
co
mmunicator
LANGUAGES CXX VERSION
${
CO
MMUNICATOR
_VERSION
}
)
set
(
CMAKE_INCLUDE_CURRENT_DIR ON
)
set
(
CMAKE_AUTOMOC ON
)
...
...
@@ -32,7 +32,7 @@ include_directories(
${
CMAKE_CURRENT_BINARY_DIR
}
/src/models/contacts
)
set
(
co
ntacts
_SRCS
set
(
co
mmunicator
_SRCS
src/main.cpp
src/models/contacts/contactsmodel.cpp
src/models/contacts/calllogs.cpp
...
...
@@ -40,8 +40,7 @@ set(contacts_SRCS
src/interfaces/contactimage.cpp
)
set
(
contacts_HDRS
src/union.h
set
(
communicator_HDRS
src/models/contacts/contactsmodel.h
src/models/contacts/calllogs.h
src/interfaces/abstractinterface.h
...
...
@@ -49,20 +48,20 @@ set(contacts_HDRS
src/interfaces/contactimage.h
)
set
(
co
ntacts
_ASSETS
set
(
co
mmunicator
_ASSETS
src/qml.qrc
assets/contacts_assets.qrc
)
add_executable
(
${
PROJECT_NAME
}
${
co
ntacts
_SRCS
}
${
co
ntacts
_HDRS
}
${
co
ntacts
_ASSETS
}
${
co
mmunicator
_SRCS
}
${
co
mmunicator
_HDRS
}
${
co
mmunicator
_ASSETS
}
)
ecm_setup_version
(
${
CO
NTACTS
_VERSION
}
VARIABLE_PREFIX CO
NTACTS
VERSION_HEADER
"
${
CMAKE_CURRENT_BINARY_DIR
}
/co
ntacts
_version.h"
ecm_setup_version
(
${
CO
MMUNICATOR
_VERSION
}
VARIABLE_PREFIX CO
MMUNICATOR
VERSION_HEADER
"
${
CMAKE_CURRENT_BINARY_DIR
}
/co
mmunicator
_version.h"
)
if
(
ANDROID
)
...
...
@@ -71,26 +70,25 @@ if (ANDROID)
target_link_libraries
(
${
PROJECT_NAME
}
Qt5::AndroidExtras
)
# kde_source_files_enable_exceptions(union src/pix.cpp)
elseif
(
${
CMAKE_SYSTEM_PROCESSOR
}
MATCHES
"arm"
)
add_subdirectory
(
src/co
ntacts
/linux
)
add_subdirectory
(
src/co
mmunicator
/linux
)
else
()
find_package
(
KF5
${
KF5_VERSION
}
REQUIRED COMPONENTS I18n Notifications Config KIO Attica Contacts People SyntaxHighlighting
)
find_package
(
Qt5 REQUIRED COMPONENTS WebEngine
)
target_link_libraries
(
${
PROJECT_NAME
}
KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::I18n KF5::Attica KF5::Contacts KF5::People KF5::SyntaxHighlighting
)
endif
()
if
(
TARGET create-apk-co
ntacts
)
set_target_properties
(
create-apk-co
ntacts
PROPERTIES ANDROID_APK_DIR
"
${
MAUIKIT_ANDROID_DIR
}
"
)
if
(
TARGET create-apk-co
mmunicator
)
set_target_properties
(
create-apk-co
mmunicator
PROPERTIES ANDROID_APK_DIR
"
${
MAUIKIT_ANDROID_DIR
}
"
)
endif
()
target_link_libraries
(
${
PROJECT_NAME
}
MauiKit Qt5::Sql Qt5::Qml Qt5::Widgets Qt5::Svg Qt5::Concurrent Qt5::Quick
)
install
(
TARGETS
${
PROJECT_NAME
}
${
KDE_INSTALL_TARGETS_DEFAULT_ARGS
}
)
install
(
FILES org.kde.co
ntacts
.desktop DESTINATION
${
XDG_APPS_INSTALL_DIR
}
)
install
(
FILES org.kde.co
mmunicator
.desktop DESTINATION
${
XDG_APPS_INSTALL_DIR
}
)
#TODO: port to ecm_install_icons()
install
(
FILES assets/contacts.svg DESTINATION
${
KDE_INSTALL_ICONDIR
}
/hicolor/scalable/apps
)
install
(
FILES org.maui.co
ntacts
.json DESTINATION /usr/share/maui-accounts/manifests
)
install
(
FILES org.maui.co
mmunicator
.json DESTINATION /usr/share/maui-accounts/manifests
)
#install(FILES org.kde.pix.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
feature_summary
(
WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES
)
co
ntacts
.pro
→
co
mmunicator
.pro
View file @
b8d91936
File moved
org.
kde.contacts
.desktop
→
org.
maui.communicator
.desktop
View file @
b8d91936
File moved
org.maui.co
ntacts
.json
→
org.maui.co
mmunicator
.json
View file @
b8d91936
File moved
src/main.cpp
View file @
b8d91936
...
...
@@ -9,77 +9,97 @@
#include <QApplication>
#endif
#include "src/union.h"
#ifdef STATIC_MAUIKIT
#include "3rdparty/mauikit/src/mauikit.h"
#include "mauiapp.h"
#else
#include <MauiKit/mauiapp.h>
#endif
#if defined Q_OS_MACOS || defined Q_OS_WIN
#include <KF5/KI18n/KLocalizedContext>
#include <KF5/KI18n/KLocalizedString>
#else
#include <KI18n/KLocalizedContext>
#include <KI18n/KLocalizedString>
#endif
#include "src/models/contacts/contactsmodel.h"
#include "src/models/contacts/calllogs.h"
#include "contactimage.h"
#ifdef STATIC_KIRIGAMI
#include "./3rdparty/kirigami/src/kirigamiplugin.h"
#endif
#ifdef STATIC_MAUIKIT
#include "./3rdparty/mauikit/src/mauikit.h"
#include <QStyleHints>
#endif
#ifndef STATIC_MAUIKIT
#include "communicator_version.h"
#endif
#define COMMUNICATOR_URI "org.maui.communicator"
int
main
(
int
argc
,
char
*
argv
[])
{
QCoreApplication
::
setAttribute
(
Qt
::
AA_EnableHighDpiScaling
);
QCoreApplication
::
setAttribute
(
Qt
::
AA_EnableHighDpiScaling
);
QCoreApplication
::
setAttribute
(
Qt
::
AA_DontCreateNativeWidgetSiblings
);
QCoreApplication
::
setAttribute
(
Qt
::
AA_UseHighDpiPixmaps
,
true
);
QCoreApplication
::
setAttribute
(
Qt
::
AA_DisableSessionManager
,
true
);
#ifdef Q_OS_ANDROID
QGuiApplication
app
(
argc
,
argv
);
if
(
!
MAUIAndroid
::
checkRunTimePermissions
({
"android.permission.WRITE_EXTERNAL_STORAGE"
,
"android.permission.READ_CALL_LOG"
,
"android.permission.SEND_SMS"
,
"android.permission.CALL_PHONE"
,
"android.permission.MANAGE_ACCOUNTS"
,
"android.permission.GET_ACCOUNTS"
,
"android.permission.READ_CONTACTS"
}))
return
-
1
;
QGuiApplication
app
(
argc
,
argv
);
if
(
!
MAUIAndroid
::
checkRunTimePermissions
({
"android.permission.WRITE_EXTERNAL_STORAGE"
,
"android.permission.READ_CALL_LOG"
,
"android.permission.SEND_SMS"
,
"android.permission.CALL_PHONE"
,
"android.permission.MANAGE_ACCOUNTS"
,
"android.permission.GET_ACCOUNTS"
,
"android.permission.READ_CONTACTS"
}))
return
-
1
;
#else
QApplication
app
(
argc
,
argv
);
QApplication
app
(
argc
,
argv
);
#endif
app
.
setApplicationName
(
UNI
::
appName
);
app
.
setApplicationVersion
(
UNI
::
version
);
app
.
setApplicationDisplayName
(
UNI
::
displayName
);
app
.
setOrganizationName
(
UNI
::
orgName
);
app
.
setOrganizationDomain
(
UNI
::
orgDomain
);
app
.
setWindowIcon
(
QIcon
(
":/contacts.svg"
));
QCommandLineParser
parser
;
parser
.
addOptions
({
// A boolean option with a single name (-p)
{
"sync"
,
QCoreApplication
::
translate
(
"main"
,
"Show progress during copy"
)},
// A boolean option with multiple names (-f, --force)
{{
"f"
,
"force"
},
QCoreApplication
::
translate
(
"main"
,
"Overwrite existing files."
)},
// An option with a value
{{
"t"
,
"target-directory"
},
QCoreApplication
::
translate
(
"main"
,
"Copy all source files into <directory>."
),
QCoreApplication
::
translate
(
"main"
,
"directory"
)},
});
parser
.
process
(
app
);
QQmlApplicationEngine
engine
;
app
.
setOrganizationName
(
QStringLiteral
(
"Maui"
));
app
.
setWindowIcon
(
QIcon
(
":/contacts.png"
));
MauiApp
::
instance
()
->
setHandleAccounts
(
false
);
//for now index can not handle cloud accounts
MauiApp
::
instance
()
->
setIconName
(
"qrc:/contacts.svg"
);
KLocalizedString
::
setApplicationDomain
(
"communicator"
);
KAboutData
about
(
QStringLiteral
(
"communicator"
),
i18n
(
"Communicator"
),
COMMUNICATOR_VERSION_STRING
,
i18n
(
"Communicator keeps your contacts synced across devices and allows you to make calls, send messages and organize."
),
KAboutLicense
::
LGPL_V3
,
i18n
(
"© 2019-2020 Nitrux Development Team"
));
about
.
addAuthor
(
i18n
(
"Camilo Higuita"
),
i18n
(
"Developer"
),
QStringLiteral
(
"milo.h@aol.com"
));
about
.
setHomepage
(
"https://mauikit.org"
);
about
.
setProductName
(
"maui/communicator"
);
about
.
setBugAddress
(
"https://invent.kde.org/maui/communicator/-/issues"
);
about
.
setOrganizationDomain
(
COMMUNICATOR_URI
);
about
.
setProgramLogo
(
app
.
windowIcon
());
KAboutData
::
setApplicationData
(
about
);
QCommandLineParser
parser
;
parser
.
process
(
app
);
about
.
setupCommandLine
(
&
parser
);
about
.
processCommandLine
(
&
parser
);
QQmlApplicationEngine
engine
;
#ifdef STATIC_KIRIGAMI
KirigamiPlugin
::
getInstance
().
registerTypes
();
KirigamiPlugin
::
getInstance
().
registerTypes
();
#endif
#ifdef STATIC_MAUIKIT
MauiKit
::
getInstance
().
registerTypes
();
MauiKit
::
getInstance
().
registerTypes
();
#endif
engine
.
addImageProvider
(
"contact"
,
new
ContactImage
(
QQuickImageProvider
::
ImageType
::
Image
));
qmlRegisterType
<
ContactsModel
>
(
"UnionModels"
,
1
,
0
,
"ContactsList"
);
qmlRegisterType
<
CallLogs
>
(
"UnionModels"
,
1
,
0
,
"CallLogs"
);
engine
.
addImageProvider
(
"contact"
,
new
ContactImage
(
QQuickImageProvider
::
ImageType
::
Image
));
qmlRegisterType
<
ContactsModel
>
(
COMMUNICATOR_URI
,
1
,
0
,
"ContactsList"
);
qmlRegisterType
<
CallLogs
>
(
COMMUNICATOR_URI
,
1
,
0
,
"CallLogs"
);
engine
.
load
(
QUrl
(
QStringLiteral
(
"qrc:/main.qml"
)));
if
(
engine
.
rootObjects
().
isEmpty
())
return
-
1
;
engine
.
load
(
QUrl
(
QStringLiteral
(
"qrc:/main.qml"
)));
if
(
engine
.
rootObjects
().
isEmpty
())
return
-
1
;
return
app
.
exec
();
return
app
.
exec
();
}
src/main.qml
View file @
b8d91936
...
...
@@ -15,8 +15,6 @@ Maui.ApplicationWindow
{
id
:
root
title
:
Maui
.
App
.
displayName
Maui.App.description
:
i18n
(
"
Contacts keeps your contacts synced across devices and allows you to make calls, send messages and organize
"
)
Maui.App.iconName
:
"
qrc:/contacts.svg
"
readonly
property
var
views
:
({
favs
:
0
,
...
...
@@ -65,7 +63,7 @@ Maui.ApplicationWindow
icon.name
:
"
view-pim-contacts
"
text
:
i18n
(
"
Contacts
"
)
}
}
SwipeView
...
...
src/union.h
deleted
100644 → 0
View file @
46880457
#ifndef UNION_H
#define UNION_H
#include <QString>
#ifndef STATIC_MAUIKIT
#include "contacts_version.h"
#endif
namespace
UNI
{
const
static
inline
QString
appName
=
"contacts"
;
const
static
inline
QString
version
=
CONTACTS_VERSION_STRING
;
const
static
inline
QString
comment
=
"Contacs manager and dialer"
;
const
static
inline
QString
displayName
=
"Contacts"
;
const
static
inline
QString
orgName
=
"Maui"
;
const
static
inline
QString
orgDomain
=
"org.maui.contacts"
;
};
#endif // UNION_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