[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,6 +2,6 @@
<service name="tar_git">
<param name="url">https://github.com/monich/harbour-logger</param>
<param name="branch">master</param>
- <param name="revision">66eb9f3</param>
+ <param name="revision">cbfc05d</param>
</service>
</services>
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/logger/logger.pro
^
|
@@ -5,8 +5,10 @@
CONFIG += sailfishapp link_pkgconfig
PKGCONFIG += mlite5 gio-2.0 gio-unix-2.0 glib-2.0
-QMAKE_CXXFLAGS += -Wno-unused-parameter -Wno-psabi
-QMAKE_CFLAGS += -Wno-unused-parameter
+WARNINGS = -Wall -Wno-unused-parameter -Wno-deprecated-declarations
+EXTRA_CFLAGS = $$WARNINGS -fvisibility=hidden
+QMAKE_CXXFLAGS += $$EXTRA_CFLAGS
+QMAKE_CFLAGS += $$EXTRA_CFLAGS
HARBOUR_LIB_DIR = $$_PRO_FILE_PWD_/../harbour-lib
HARBOUR_LIB_SRC = $${HARBOUR_LIB_DIR}/src
@@ -26,8 +28,13 @@
LIBDBUSLOG_CLIENT_INCLUDE = $${LIBDBUSLOG_CLIENT}/include
CONFIG(debug, debug|release) {
- DEFINES += HARBOUR_DEBUG=1
- DEFINES += DEBUG=1
+ QMAKE_CXXFLAGS_DEBUG *= -O0
+ QMAKE_CFLAGS_DEBUG *= -O0
+ DEFINES += DEBUG HARBOUR_DEBUG
+} else {
+ EXTRA_RELEASE_CFLAGS = -fPIC -flto -ffat-lto-objects
+ QMAKE_CXXFLAGS += $$EXTRA_RELEASE_CFLAGS
+ QMAKE_CFLAGS += $$EXTRA_RELEASE_CFLAGS
}
openrepos {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/logger/qml/pages/CoverPage.qml
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016 Jolla Ltd.
- * Contact: Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2021 Jolla Ltd.
+ * Copyright (C) 2016-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -13,9 +13,9 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Jolla Ltd nor the names of its contributors may
- * be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -39,7 +39,6 @@
CoverBackground {
id: cover
- allowResize: true
readonly property bool _privileged: ProcessState.privileged
Label {
@@ -65,14 +64,13 @@
top: title.bottom
left: parent.left
right: parent.right
- bottom: parent.bottom
leftMargin: Theme.paddingMedium
rightMargin: Theme.paddingSmall
- bottomMargin: Theme.itemSizeSmall
}
+ height: Math.min(contentHeight, parent.height - y - Theme.itemSizeSmall/cover.parent.scale)
+ verticalLayoutDirection: ListView.BottomToTop
model: LogModel
- onCountChanged: positioner.start()
- onHeightChanged: scrollToEnd()
+ clip: true
delegate: Label {
text: messageText
width: parent.width
@@ -80,22 +78,10 @@
truncationMode: TruncationMode.Fade
font.pixelSize: Theme.fontSizeTiny
}
- function scrollToEnd() {
- if (count > 1) {
- // FsIoLog model has one extra item at the end
- positionViewAtIndex(count - 2, ListView.End)
- }
- }
- Timer {
- // positionViewAtXxx() doesn't work directly from onCountChanged
- id: positioner
- interval: 0
- onTriggered: list.scrollToEnd()
- }
}
OpacityRampEffect {
- enabled: !list.atYBeginning
+ enabled: list.contentHeight > list.height
sourceItem: list
parent: cover
direction: OpacityRamp.BottomToTop
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/logger/settings/settings.qml
^
|
@@ -71,7 +71,7 @@
description: applicationName ?
//: Settings page header description (app version)
//% "Version %1"
- qsTrId("logger-settings-page-header-version").arg("1.0.20") :
+ qsTrId("logger-settings-page-header-version").arg("1.0.21") :
""
Image {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/logger/src/LoggerCategoryModel.cpp
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2017 Jolla Ltd.
- * Contact: Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2021 Jolla Ltd.
+ * Copyright (C) 2016-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -13,9 +13,9 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Jolla Ltd nor the names of its contributors may
- * be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -45,6 +45,7 @@
DBusLogClient* aClient, QObject* aParent) : SUPER(aParent),
iSettings(aSettings),
iClient(dbus_log_client_ref(aClient)),
+ iDefaultLevel(DBUSLOG_LEVEL_UNDEFINED),
iHaveDefaults(false)
{
memset(iClientSignals, 0, sizeof(iClientSignals));
@@ -161,6 +162,13 @@
dbus_log_client_disable_pattern(iClient, "*", NULL, NULL);
}
+void LoggerCategoryModel::restoreLogLevel() const
+{
+ if (iDefaultLevel != DBUSLOG_LEVEL_UNDEFINED) {
+ dbus_log_client_set_default_level(iClient, iDefaultLevel, NULL, NULL);
+ }
+}
+
void LoggerCategoryModel::resetCategories(QList<LoggerCategory> aCategories)
{
GStrV* enable = NULL;
@@ -281,6 +289,10 @@
iCategories.insert(cat->id, LoggerCategory(cat));
}
endResetModel();
+ // Save the log level so that we can restore it on exit
+ if (iDefaultLevel == DBUSLOG_LEVEL_UNDEFINED) {
+ iDefaultLevel = iClient->default_level;
+ }
// Make sure that verbose logging is enabled. The default is often
// DEBUG which turns off e.g. RIL data dump in ofono
if (iClient->default_level < DBUSLOG_LEVEL_VERBOSE) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/logger/src/LoggerCategoryModel.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2017 Jolla Ltd.
- * Contact: Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2021 Jolla Ltd.
+ * Copyright (C) 2016-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -13,9 +13,9 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Jolla Ltd nor the names of its contributors may
- * be used to endorse or promote products derived from this software
- * without specific prior written permission.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -67,6 +67,7 @@
int count() const;
bool isConnected() const;
bool haveDefaults() const;
+ void restoreLogLevel() const;
LoggerCategory loggerCategoryAt(int aRow) const;
void resetCategories(QList<LoggerCategory> aCategories);
@@ -115,6 +116,7 @@
DBusLogClient* iClient;
gulong iClientSignals[DBusLogClientSignalCount];
QHash<guint32,LoggerCategory> iCategories;
+ DBUSLOG_LEVEL iDefaultLevel;
bool iHaveDefaults;
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/logger/src/LoggerMain.cpp
^
|
@@ -235,6 +235,7 @@
int ret = iApp->exec();
if (logSettings->autoResetLogging()) {
+ categoryModel->restoreLogLevel();
categoryModel->reset();
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/nfc/nfc.pro
^
|
@@ -20,16 +20,19 @@
QT += dbus
WARNINGS = -Wall -Wno-unused-parameter -Wno-deprecated-declarations
-QMAKE_CXXFLAGS += $$WARNINGS -Wno-psabi
-QMAKE_CFLAGS += $$WARNINGS
+EXTRA_CFLAGS = $$WARNINGS -fvisibility=hidden
+QMAKE_CXXFLAGS += $$EXTRA_CFLAGS
+QMAKE_CFLAGS += $$EXTRA_CFLAGS
CONFIG(debug, debug|release) {
- QMAKE_CXXFLAGS_DEBUG *= -O0
- QMAKE_CFLAGS_DEBUG *= -O0
-}
-
-CONFIG(debug, debug|release) {
- DEFINES += HARBOUR_DEBUG=1
+ QMAKE_CXXFLAGS_DEBUG *= -O0
+ QMAKE_CFLAGS_DEBUG *= -O0
+ DEFINES += DEBUG HARBOUR_DEBUG
+} else {
+ EXTRA_RELEASE_CFLAGS = -fPIC -flto -ffat-lto-objects
+ QMAKE_CXXFLAGS += $$EXTRA_RELEASE_CFLAGS
+ QMAKE_CFLAGS += $$EXTRA_RELEASE_CFLAGS
+ QMAKE_LFLAGS += -fPIC -flto
}
# Directories
@@ -102,11 +105,14 @@
for(s, ICON_SIZES) {
icon_target = icon$${s}
icon_dir = icons/$${s}x$${s}
- $${icon_target}.files = $${icon_dir}/$${TARGET}.png
$${icon_target}.path = /usr/share/icons/hicolor/$${s}x$${s}/apps
openrepos {
- $${icon_target}.extra = cp $${icon_dir}/harbour-$${NAME}.png $$eval($${icon_target}.files)
$${icon_target}.CONFIG += no_check_exist
+ $${icon_target}.files = $${OUT_PWD}/$${icon_dir}/$${TARGET}.png
+ $${icon_target}.extra = mkdir -p \"$${OUT_PWD}/$${icon_dir}\" && \
+ cp \"$${_PRO_FILE_PWD_}/$${icon_dir}/harbour-$${NAME}.png\" \"$${OUT_PWD}/$${icon_dir}/$${TARGET}.png\"
+ } else {
+ $${icon_target}.files = $${icon_dir}/$${TARGET}.png
}
INSTALLS += $${icon_target}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/ofono.pro
^
|
@@ -20,16 +20,20 @@
QT += dbus
WARNINGS = -Wall -Wno-unused-parameter -Wno-deprecated-declarations
-QMAKE_CXXFLAGS += $$WARNINGS -Wno-psabi
-QMAKE_CFLAGS += $$WARNINGS
+EXTRA_CFLAGS = $$WARNINGS -fvisibility=hidden
+DEFINES += QOFONOEXT_EXPORT=Q_DECL_HIDDEN
+QMAKE_CXXFLAGS += $$EXTRA_CFLAGS
+QMAKE_CFLAGS += $$EXTRA_CFLAGS
CONFIG(debug, debug|release) {
- QMAKE_CXXFLAGS_DEBUG *= -O0
- QMAKE_CFLAGS_DEBUG *= -O0
-}
-
-CONFIG(debug, debug|release) {
- DEFINES += HARBOUR_DEBUG=1
+ QMAKE_CXXFLAGS_DEBUG *= -O0
+ QMAKE_CFLAGS_DEBUG *= -O0
+ DEFINES += DEBUG HARBOUR_DEBUG
+} else {
+ EXTRA_RELEASE_CFLAGS = -fPIC -flto -ffat-lto-objects
+ QMAKE_CXXFLAGS += $$EXTRA_RELEASE_CFLAGS
+ QMAKE_CFLAGS += $$EXTRA_RELEASE_CFLAGS
+ QMAKE_LFLAGS += -fPIC -flto
}
# Directories
@@ -120,11 +124,14 @@
for(s, ICON_SIZES) {
icon_target = icon$${s}
icon_dir = icons/$${s}x$${s}
- $${icon_target}.files = $${icon_dir}/$${TARGET}.png
$${icon_target}.path = /usr/share/icons/hicolor/$${s}x$${s}/apps
openrepos {
- $${icon_target}.extra = cp $${icon_dir}/harbour-$${NAME}.png $$eval($${icon_target}.files)
$${icon_target}.CONFIG += no_check_exist
+ $${icon_target}.files = $${OUT_PWD}/$${icon_dir}/$${TARGET}.png
+ $${icon_target}.extra = mkdir -p \"$${OUT_PWD}/$${icon_dir}\" && \
+ cp \"$${_PRO_FILE_PWD_}/$${icon_dir}/harbour-$${NAME}.png\" \"$${OUT_PWD}/$${icon_dir}/$${TARGET}.png\"
+ } else {
+ $${icon_target}.files = $${icon_dir}/$${TARGET}.png
}
INSTALLS += $${icon_target}
}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/LICENSE.LGPL
^
|
@@ -0,0 +1,12 @@
+Copyright (C) 2015-2021 Jolla Ltd.
+Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/README
^
|
@@ -1,4 +1,5 @@
qofono-ext
-=========
+==========
-A library for accessing nemomobile specific ofono extensions, and a declarative plugin for it.
+A library for accessing Sailfish OS specific ofono extensions,
+and a declarative plugin for it.
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/libqofonoext.pro
^
|
@@ -1,5 +1,5 @@
TEMPLATE = subdirs
SUBDIRS += src plugin
-OTHER_FILES += rpm/libqofonoext.spec README
+OTHER_FILES += rpm/libqofonoext.spec LICENSE.LGPL README
src.target = src-target
plugin.depends = src-target
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/plugin/plugins.qmltypes
^
|
@@ -52,6 +52,7 @@
Property { name: "rssnr"; type: "int"; isReadonly: true }
Property { name: "cqi"; type: "int"; isReadonly: true }
Property { name: "timingAdvance"; type: "int"; isReadonly: true }
+ Property { name: "signalLevelDbm"; type: "int"; isReadonly: true }
Signal {
name: "propertyChanged"
Parameter { name: "name"; type: "string" }
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/plugin/qofonoextdeclarativeplugin.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015-2016 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/plugin/qofonoextdeclarativeplugin.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015-2016 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/plugin/qofonoextmodemlistmodel.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015-2017 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/plugin/qofonoextmodemlistmodel.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015-2017 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/plugin/qofonoextsimlistmodel.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016-2018 Jolla Ltd.
-** Contact: slava.monich@jolla.com
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/plugin/qofonoextsimlistmodel.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016-2018 Jolla Ltd.
-** Contact: slava.monich@jolla.com
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/rpm/libqofonoext.spec
^
|
@@ -1,19 +1,27 @@
Name: libqofonoext
Summary: A library of Qt bindings for ofono extensions
-Version: 1.0.25
+Version: 1.0.28
Release: 1
-Group: System/Libraries
License: LGPLv2
-URL: https://git.sailfishos.org/mer-core/libqofonoext
+URL: https://github.com/sailfishos/libgofonoext
Source0: %{name}-%{version}.tar.bz2
-Requires(post): /sbin/ldconfig
-Requires(postun): /sbin/ldconfig
-Requires: libqofono-qt5 >= 0.87
+
+%define libqofono_version 0.101
+
+BuildRequires: pkgconfig
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Quick)
-BuildRequires: pkgconfig(qofono-qt5) >= 0.87
+BuildRequires: pkgconfig(qofono-qt5) >= %{libqofono_version}
+
+# license macro requires rpm >= 4.11
+BuildRequires: pkgconfig(rpm)
+%define license_support %(pkg-config --exists 'rpm >= 4.11'; echo $?)
+
+Requires: libqofono-qt5 >= %{libqofono_version}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
%{!?qtc_qmake5:%define qtc_qmake5 %qmake5}
%{!?qtc_make:%define qtc_make make}
@@ -23,7 +31,6 @@
%package declarative
Summary: Declarative plugin for %{name}
-Group: Development/Tools
Requires: %{name} = %{version}-%{release}
Requires: %{name} = %{version}
@@ -32,7 +39,6 @@
%package devel
Summary: Development files for %{name}
-Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: %{name} = %{version}
@@ -57,6 +63,9 @@
%files
%defattr(-,root,root,-)
%{_libdir}/%{name}.so.*
+%if %{license_support} == 0
+%license LICENSE.LGPL
+%endif
%files declarative
%defattr(-,root,root,-)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoext.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoext_p.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 Jolla Ltd.
-** Contact: slava.monich@jollamobile.com
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoext_types.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 Jolla Ltd.
-** Contact: slava.monich@jollamobile.com
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -18,10 +18,12 @@
#include <QtCore>
-#if defined(QOFONOEXT_LIBRARY)
-# define QOFONOEXT_EXPORT Q_DECL_EXPORT
-#else
-# define QOFONOEXT_EXPORT Q_DECL_IMPORT
-#endif
+#ifndef QOFONOEXT_EXPORT
+# if defined(QOFONOEXT_LIBRARY)
+# define QOFONOEXT_EXPORT Q_DECL_EXPORT
+# else
+# define QOFONOEXT_EXPORT Q_DECL_IMPORT
+# endif
+#endif // QOFONOEXT_EXPORT
#endif // QOFONOEXT_TYPES_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextcell.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016-2017 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -17,9 +17,13 @@
#include "qofonoextcellinfo.h"
#include "qofonoext_p.h"
-static const QString kTypeGsm("gsm");
-static const QString kTypeWcdma("wcdma");
-static const QString kTypeLte("lte");
+namespace {
+ const QString kTypeGsm("gsm");
+ const QString kTypeWcdma("wcdma");
+ const QString kTypeLte("lte");
+
+ const QString kMethodGetAll("GetAll");
+}
#define CELL_PROPERTIES(p) \
p(mcc) p(mnc) p(signalStrength) p(lac) p(cid) p(arfcn) p(bsic) \
@@ -44,10 +48,10 @@
"org.nemomobile.ofono.Cell", OFONO_BUS, aParent) {}
public Q_SLOTS: // METHODS
- QDBusPendingCall GetInterfaceVersion()
- { return asyncCall("GetInterfaceVersion"); }
- QDBusPendingCall GetAll()
- { return asyncCall("GetAll"); }
+ QDBusPendingCall GetAllAsync()
+ { return asyncCall(kMethodGetAll); }
+ QDBusMessage GetAllSync()
+ { return call(kMethodGetAll); }
Q_SIGNALS: // SIGNALS
void PropertyChanged(QString aName, QDBusVariant aValue);
@@ -78,29 +82,45 @@
static const PropertyDesc Properties[PropertyCount];
+ typedef QDBusPendingReply <
+ int, // 0. version
+ QString, // 1. type
+ bool, // 2. registered
+ QVariantMap> // 3. properties
+ GetAllReply;
+
Private(QString aPath, QOfonoExtCell* aParent);
+ void getAllSyncInit();
+
static int value(Private* aThis, Property aProperty);
static Type typeFromString(QString aType);
static Property propertyFromString(QString aProperty);
+ static int getRssiDbm(int aSignalStrength);
+ static int inRange(int aValue, int aRangeMin, int aRangeMax);
private:
- void getAll();
+ QOfonoExtCell* cell();
+ void getAllAsync();
+ bool pathValid();
+ bool updateSignalLevelDbm();
+ void handleGetAllReply(GetAllReply aReply, bool aEmitSignals);
+
+public Q_SLOTS:
+ void updateAllAsync();
private Q_SLOTS:
- void onCellsChanged();
void onGetAllFinished(QDBusPendingCallWatcher* aWatcher);
void onPropertyChanged(QString aName, QDBusVariant aValue);
void onRegisteredChanged(bool aRegistered);
public:
bool iValid;
- bool iFixedPath;
bool iRegistered;
int iProperties[PropertyCount];
+ int iSignalLevelDbm;
QOfonoExtCell::Type iType;
private:
- QOfonoExtCell* iParent;
QDBusPendingCallWatcher* iPendingGetAll;
QSharedPointer<QOfonoExtCellInfo> iCellInfo;
};
@@ -113,11 +133,10 @@
QOfonoExtCell::Private::Private(QString aPath, QOfonoExtCell* aParent) :
QOfonoExtCellProxy(aPath, aParent),
iValid(false),
- iFixedPath(false),
iRegistered(false),
+ iSignalLevelDbm(InvalidValue),
iType(UNKNOWN),
- iParent(aParent),
- iPendingGetAll(NULL)
+ iPendingGetAll(Q_NULLPTR)
{
// Extract modem path from the cell path, e.g. "/ril_0/cell_0" => "/ril_0"
iCellInfo = QOfonoExtCellInfo::instance(aPath.left(aPath.lastIndexOf('/')));
@@ -132,11 +151,15 @@
SLOT(onRegisteredChanged(bool)));
connect(iCellInfo.data(),
SIGNAL(cellsChanged()),
- SLOT(onCellsChanged()));
+ SLOT(updateAllAsync()));
connect(iCellInfo.data(),
SIGNAL(validChanged()),
- SLOT(onCellsChanged()));
- onCellsChanged();
+ SLOT(updateAllAsync()));
+}
+
+inline QOfonoExtCell* QOfonoExtCell::Private::cell()
+{
+ return qobject_cast<QOfonoExtCell*>(parent());
}
QOfonoExtCell::Type QOfonoExtCell::Private::typeFromString(QString aType)
@@ -162,29 +185,56 @@
return aThis ? aThis->iProperties[aProperty] : InvalidValue;
}
-void QOfonoExtCell::Private::onCellsChanged()
+bool QOfonoExtCell::Private::pathValid()
{
- bool pathValid = iCellInfo->valid() && iCellInfo->cells().contains(path());
- if (pathValid) {
+ return iCellInfo->valid() && iCellInfo->cells().contains(path());
+}
+
+void QOfonoExtCell::Private::updateAllAsync()
+{
+ if (pathValid()) {
if (!iValid && !iPendingGetAll) {
- getAll();
+ getAllAsync();
}
} else {
if (iPendingGetAll) {
delete iPendingGetAll;
- iPendingGetAll = NULL;
+ iPendingGetAll = Q_NULLPTR;
}
if (iValid) {
iValid = false;
- Q_EMIT iParent->validChanged();
+ Q_EMIT cell()->validChanged();
}
}
}
-void QOfonoExtCell::Private::getAll()
+int QOfonoExtCell::Private::getRssiDbm(int aValue)
+{
+ // Range for RSSI in ASU (0-31, 99) as defined in TS 27.007 8.69
+ return (aValue < 0 || aValue > 31) ? InvalidValue : (-113 + (2 * aValue));
+}
+
+int QOfonoExtCell::Private::inRange(int aValue, int aMin, int aMax)
+{
+ return (aValue < aMin || aValue > aMax) ? InvalidValue : aValue;
+}
+
+void QOfonoExtCell::Private::getAllSyncInit()
+{
+ if (iPendingGetAll) {
+ delete iPendingGetAll;
+ iPendingGetAll = NULL;
+ }
+ GetAllReply reply(GetAllSync());
+ if (!reply.isError()) {
+ handleGetAllReply(reply, false);
+ }
+}
+
+void QOfonoExtCell::Private::getAllAsync()
{
delete iPendingGetAll;
- iPendingGetAll = new QDBusPendingCallWatcher(GetAll(), this);
+ iPendingGetAll = new QDBusPendingCallWatcher(GetAllAsync(), this);
connect(iPendingGetAll,
SIGNAL(finished(QDBusPendingCallWatcher*)),
SLOT(onGetAllFinished(QDBusPendingCallWatcher*)));
@@ -192,63 +242,77 @@
void QOfonoExtCell::Private::onGetAllFinished(QDBusPendingCallWatcher* aWatcher)
{
- QDBusPendingReply <
- int, // 0. version
- QString, // 1. type
- bool, // 2. registered
- QVariantMap> // 3. properties
- reply(*aWatcher);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextcell.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016-2017 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -44,6 +44,7 @@
Q_PROPERTY(int rssnr READ rssnr NOTIFY rssnrChanged)
Q_PROPERTY(int cqi READ cqi NOTIFY cqiChanged)
Q_PROPERTY(int timingAdvance READ timingAdvance NOTIFY timingAdvanceChanged)
+ Q_PROPERTY(int signalLevelDbm READ signalLevelDbm NOTIFY signalLevelDbmChanged)
Q_ENUMS(Type)
Q_ENUMS(Constants)
@@ -60,7 +61,8 @@
InvalidValue = INT_MAX
};
- explicit QOfonoExtCell(QObject* aParent = NULL);
+ explicit QOfonoExtCell(QObject* aParent = Q_NULLPTR);
+ QOfonoExtCell(QString aPath, bool aMayBlock); // Since 1.0.27
QOfonoExtCell(QString aPath);
~QOfonoExtCell();
@@ -75,6 +77,7 @@
int mcc() const;
int mnc() const;
int signalStrength() const;
+ int signalLevelDbm() const;
// GSM:
int arfcn() const;
@@ -124,6 +127,7 @@
void rssnrChanged();
void cqiChanged();
void timingAdvanceChanged();
+ void signalLevelDbmChanged();
void propertyChanged(QString name, int value);
void removed();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextcellinfo.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016-2017 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -18,6 +18,8 @@
#include <qofonomodem.h>
+static const QString kMethodGetCells("GetCells");
+
typedef QMap<QString,QWeakPointer<QOfonoExtCellInfo> > QOfonoExtCellInfoMap;
Q_GLOBAL_STATIC(QOfonoExtCellInfoMap, sharedInstances)
@@ -39,10 +41,10 @@
OFONO_BUS, aParent) {}
public Q_SLOTS: // METHODS
- QDBusPendingCall GetInterfaceVersion()
- { return asyncCall("GetInterfaceVersion"); }
- QDBusPendingCall GetCells()
- { return asyncCall("GetCells"); }
+ QDBusPendingCall GetCellsAsync()
+ { return asyncCall(kMethodGetCells); }
+ QDBusMessage GetCellsSync()
+ { return call(kMethodGetCells); }
Q_SIGNALS: // SIGNALS
void CellsAdded(QList<QDBusObjectPath> aPaths);
@@ -63,13 +65,18 @@
Private(QOfonoExtCellInfo* aParent);
QString modemPath() const;
void setModemPath(QString aPath);
+ void setModemPathSyncInit(QString aPath);
private:
- void getCells();
+ void getCellsSyncInit();
+ void getCellsAsync();
void invalidate();
+ void setModemPath(QString aPath, QSharedPointer<QOfonoModem> aModem, void (Private::*aGetCells)());
+ void checkInterfacePresence(void (Private::*getCellsFn)());
+ static QStringList getPaths(const QList<QDBusObjectPath> aPaths);
private Q_SLOTS:
- void checkInterfacePresence();
+ void onModemChanged();
void onGetCellsFinished(QDBusPendingCallWatcher* aWatcher);
void onCellsAdded(QList<QDBusObjectPath> aCells);
void onCellsRemoved(QList<QDBusObjectPath> aCells);
@@ -94,38 +101,68 @@
{
}
-QString QOfonoExtCellInfo::Private::modemPath() const
+inline QString QOfonoExtCellInfo::Private::modemPath() const
{
return iModem.isNull() ? QString() : iModem->objectPath();
}
-void QOfonoExtCellInfo::Private::setModemPath(QString aPath)
+inline void QOfonoExtCellInfo::Private::setModemPath(QString aPath)
+{
+ setModemPath(aPath, QOfonoModem::instance(aPath), &Private::getCellsAsync);
+}
+
+inline void QOfonoExtCellInfo::Private::setModemPathSyncInit(QString aPath)
+{
+ setModemPath(aPath, QOfonoModem::instance(aPath, true), &Private::getCellsSyncInit);
+}
+
+void QOfonoExtCellInfo::Private::setModemPath(QString aPath,
+ QSharedPointer<QOfonoModem> aModem, void (Private::*aGetCells)())
{
// Caller has checked the the path has actually changed
invalidate();
if (aPath.isEmpty()) {
- iModem.clear();
+ if (iModem) {
+ iModem->disconnect(this);
+ iModem.clear();
+ }
} else {
if (iModem) iModem->disconnect(this);
- iModem = QOfonoModem::instance(aPath);
+ iModem = aModem;
connect(iModem.data(),
SIGNAL(validChanged(bool)),
- SLOT(checkInterfacePresence()));
+ SLOT(onModemChanged()));
connect(iModem.data(),
SIGNAL(interfacesChanged(QStringList)),
- SLOT(checkInterfacePresence()));
- checkInterfacePresence();
+ SLOT(onModemChanged()));
+ checkInterfacePresence(aGetCells);
}
}
-void QOfonoExtCellInfo::Private::getCells()
+void QOfonoExtCellInfo::Private::getCellsAsync()
{
- connect(new QDBusPendingCallWatcher(iProxy->GetCells(), iProxy),
+ connect(new QDBusPendingCallWatcher(iProxy->GetCellsAsync(), iProxy),
SIGNAL(finished(QDBusPendingCallWatcher*)),
SLOT(onGetCellsFinished(QDBusPendingCallWatcher*)));
}
-void QOfonoExtCellInfo::Private::checkInterfacePresence()
+void QOfonoExtCellInfo::Private::getCellsSyncInit()
+{
+ QDBusPendingReply<QList<QDBusObjectPath> > reply(iProxy->GetCellsSync());
+ if (!reply.isError()) {
+ iCells = getPaths(reply.value());
+ iValid = true;
+ } else {
+ // Repeat call asynchronously on timeout
+ QDBusError error(reply.error());
+ qWarning() << error;
+ if (QOfonoExt::isTimeout(error)) {
+ getCellsAsync();
+ }
+ }
+}
+
+void QOfonoExtCellInfo::Private::checkInterfacePresence(void (Private::*aGetCells)())
{
if (iModem && iModem->isValid() &&
iModem->interfaces().contains(QOfonoExtCellInfoProxy::INTERFACE)) {
@@ -138,7 +175,7 @@
connect(iProxy,
SIGNAL(CellsRemoved(QList<QDBusObjectPath>)),
SLOT(onCellsRemoved(QList<QDBusObjectPath>)));
- getCells();
+ (this->*aGetCells)();
} else {
invalidate();
}
@@ -160,22 +197,29 @@
}
}
+QStringList QOfonoExtCellInfo::Private::getPaths(const QList<QDBusObjectPath> aPaths)
+{
+ QStringList list;
+ const int n = aPaths.count();
+ for (int i = 0; i < n; i++) {
+ list.append(aPaths.at(i).path());
+ }
+ list.sort();
+ return list;
+}
+
void QOfonoExtCellInfo::Private::onGetCellsFinished(QDBusPendingCallWatcher* aWatcher)
{
QDBusPendingReply<QList<QDBusObjectPath> > reply(*aWatcher);
if (reply.isError()) {
// Repeat the call on timeout
- qWarning() << reply.error();
- if (QOfonoExt::isTimeout(reply.error())) {
- getCells();
+ QDBusError error(reply.error());
+ qWarning() << error;
+ if (QOfonoExt::isTimeout(error)) {
+ getCellsAsync();
}
} else {
- QList<QDBusObjectPath> pathList = reply.value();
- QStringList list;
- for (int i=0; i<pathList.count(); i++) {
- list.append(pathList.at(i).path());
- }
- list.sort();
+ const QStringList list(getPaths(reply.value()));
if (iCells != list) {
iCells = list;
Q_EMIT iParent->cellsChanged();
@@ -188,6 +232,11 @@
aWatcher->deleteLater();
}
+void QOfonoExtCellInfo::Private::onModemChanged()
+{
+ checkInterfacePresence(&Private::getCellsAsync);
+}
+
void QOfonoExtCellInfo::Private::onCellsAdded(QList<QDBusObjectPath> aCells)
{
QStringList cells;
@@ -230,17 +279,35 @@
{
}
+QOfonoExtCellInfo::QOfonoExtCellInfo(QString aModemPath, QObject* aParent) : // Since 1.0.27
+ QObject(aParent),
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextcellinfo.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -26,11 +26,13 @@
Q_PROPERTY(QStringList cells READ cells NOTIFY cellsChanged)
public:
- explicit QOfonoExtCellInfo(QObject* aParent = NULL);
+ explicit QOfonoExtCellInfo(QObject* aParent = Q_NULLPTR);
+ QOfonoExtCellInfo(QString aModemPath, QObject* aParent = Q_NULLPTR); // Blocks (since 1.0.27)
~QOfonoExtCellInfo();
// Shared instance(s) for C++ use
static QSharedPointer<QOfonoExtCellInfo> instance(QString aModemPath);
+ static QSharedPointer<QOfonoExtCellInfo> instance(QString aModemPath, bool aMayBlock); // Since 1.0.27
QString modemPath() const;
void setModemPath(QString aModemPath);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextcellwatcher.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextcellwatcher.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextmodemmanager.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015-2017 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextmodemmanager.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015-2017 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextsiminfo.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016-2017 Jolla Ltd.
-** Contact: slava.monich@jolla.com
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextsiminfo.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 Jolla Ltd.
-** Contact: slava.monich@jolla.com
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.21.tar.bz2/ofono/src/libqofonoext/src/version.pri
^
|
@@ -1 +1 @@
-VERSION = 1.0.25
+VERSION = 1.0.28
|