[-]
[+]
|
Added |
_service:tar_git:openrepos-logger-ofono.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-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">cbfc05d</param>
+ <param name="revision">c3661ee</param>
</service>
</services>
\ No newline at end of file
|
[-]
[+]
|
Deleted |
_service:tar_git:openrepos-logger-ofono-1.0.21.tar.bz2/logger/src/libglibutil/debian/libglibutil-dev.install
^
|
@@ -1,3 +0,0 @@
-debian/tmp/usr/lib/libglibutil.so usr/lib
-include/*.h usr/include/gutil
-build/libglibutil.pc usr/lib/pkgconfig
|
[-]
[+]
|
Deleted |
_service:tar_git:openrepos-logger-ofono-1.0.21.tar.bz2/logger/src/libglibutil/debian/libglibutil.install
^
|
@@ -1 +0,0 @@
-debian/tmp/usr/lib/libglibutil.so.* usr/lib
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/include/LoggerMain.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2019 Jolla Ltd.
- * Copyright (C) 2016-2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2022 Jolla Ltd.
+ * Copyright (C) 2016-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -45,7 +45,8 @@
public:
LoggerMain(int* aArgc, char** aArgv, const char* aService,
- QStringList aRpmPackages, QString aAppSuffix, QString aQmlPath);
+ QStringList aRpmPackages, QString aAppPrefix, QString aAppSuffix,
+ QString aQmlPath, QString aTransDir);
virtual ~LoggerMain();
int run();
@@ -67,13 +68,13 @@
protected:
QGuiApplication* iApp;
- QString iService;
- QStringList iRpmPackages;
- QString iAppSuffix;
- QString iQmlPath;
+ const QString iService;
+ const QStringList iRpmPackages;
+ const QString iFullAppName;
+ const QString iAppSuffix;
+ const QString iQmlPath;
+ const QString iTransDir;
struct dbus_log_client* iClient;
- QString iFullAppName;
- QString iTransDir;
};
#endif // LOGGER_MAIN_H
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/logger.pro
^
|
@@ -15,8 +15,6 @@
HARBOUR_LIB_INCLUDE = $${HARBOUR_LIB_DIR}/include
LIBGLIBUTIL = src/libglibutil
-LIBGLIBUTIL_SRC = $${LIBGLIBUTIL}/src
-LIBGLIBUTIL_INCLUDE = $${LIBGLIBUTIL}/include
LIBDBUSLOG = src/libdbuslog
LIBDBUSLOG_COMMON = $${LIBDBUSLOG}/common
@@ -66,18 +64,18 @@
src/LoggerSettings.h
SOURCES += \
- $${HARBOUR_LIB_SRC}/HarbourProcessState.cpp \
- $${HARBOUR_LIB_SRC}/HarbourSigChildHandler.cpp \
- $${HARBOUR_LIB_SRC}/HarbourSystemInfo.cpp \
- $${HARBOUR_LIB_SRC}/HarbourTransferMethodInfo.cpp \
- $${HARBOUR_LIB_SRC}/HarbourTransferMethodsModel.cpp
+ $${HARBOUR_LIB_SRC}/HarbourProcessState.cpp \
+ $${HARBOUR_LIB_SRC}/HarbourSigChildHandler.cpp \
+ $${HARBOUR_LIB_SRC}/HarbourSystemInfo.cpp \
+ $${HARBOUR_LIB_SRC}/HarbourTransferMethodInfo.cpp \
+ $${HARBOUR_LIB_SRC}/HarbourTransferMethodsModel.cpp
HEADERS += \
- $${HARBOUR_LIB_INCLUDE}/HarbourProcessState.h \
- $${HARBOUR_LIB_INCLUDE}/HarbourSigChildHandler.h \
- $${HARBOUR_LIB_INCLUDE}/HarbourSystemInfo.h \
- $${HARBOUR_LIB_INCLUDE}/HarbourTransferMethodInfo.h \
- $${HARBOUR_LIB_INCLUDE}/HarbourTransferMethodsModel.h
+ $${HARBOUR_LIB_INCLUDE}/HarbourProcessState.h \
+ $${HARBOUR_LIB_INCLUDE}/HarbourSigChildHandler.h \
+ $${HARBOUR_LIB_INCLUDE}/HarbourSystemInfo.h \
+ $${HARBOUR_LIB_INCLUDE}/HarbourTransferMethodInfo.h \
+ $${HARBOUR_LIB_INCLUDE}/HarbourTransferMethodsModel.h
SOURCES += \
$${LIBDBUSLOG_COMMON_SRC}/dbuslog_category.c \
@@ -87,30 +85,24 @@
$${LIBDBUSLOG_CLIENT_SRC}/dbuslog_client.c \
$${LIBDBUSLOG_CLIENT_SRC}/dbuslog_receiver.c
-SOURCES += \
- $${LIBGLIBUTIL_SRC}/gutil_log.c \
- $${LIBGLIBUTIL_SRC}/gutil_misc.c \
- $${LIBGLIBUTIL_SRC}/gutil_ring.c \
- $${LIBGLIBUTIL_SRC}/gutil_strv.c
-
INCLUDEPATH += \
include \
$${HARBOUR_LIB_INCLUDE} \
$${LIBDBUSLOG_COMMON_INCLUDE} \
$${LIBDBUSLOG_CLIENT_INCLUDE} \
- $${LIBGLIBUTIL_INCLUDE}
+ $${LIBGLIBUTIL}/include
OTHER_FILES += \
- qml/pages/*.js \
- qml/pages/*.qml \
- qml/pages/images/*.svg \
- settings/*.qml \
- settings/*.json
+ qml/pages/*.js \
+ qml/pages/*.qml \
+ qml/pages/images/*.svg \
+ settings/*.qml \
+ settings/*.json
DBUS_SPEC_DIR = $$_PRO_FILE_PWD_/src/libdbuslog/spec
OTHER_FILES += \
- $${DBUS_SPEC_DIR}/org.nemomobile.Logger.xml
+ $${DBUS_SPEC_DIR}/org.nemomobile.Logger.xml
# org.nemomobile.Logger
DBUSLOGGER_XML = $${DBUS_SPEC_DIR}/org.nemomobile.Logger.xml
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/settings/settings.qml
^
|
@@ -48,7 +48,7 @@
var parts = Qt.resolvedUrl("dummy").split('/')
if (parts.length > 2) {
var name = parts[parts.length-3]
- if (name.indexOf("-logger") >= 0) {
+ if (name.indexOf("-log") >= 0) {
return name
}
}
@@ -71,7 +71,7 @@
description: applicationName ?
//: Settings page header description (app version)
//% "Version %1"
- qsTrId("logger-settings-page-header-version").arg("1.0.21") :
+ qsTrId("logger-settings-page-header-version").arg("1.0.22") :
""
Image {
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/LoggerMain.cpp
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2021 Jolla Ltd.
- * Copyright (C) 2016-2021 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2022 Jolla Ltd.
+ * Copyright (C) 2016-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -65,21 +65,17 @@
}
LoggerMain::LoggerMain(int* aArgc, char** aArgv, const char* aService,
- QStringList aRpmPackages, QString aAppSuffix, QString aQmlPath) :
+ QStringList aRpmPackages, QString aAppPrefix, QString aAppSuffix,
+ QString aQmlPath, QString aTransDir) :
iApp(SailfishApp::application(*aArgc, aArgv)),
iService(aService),
iRpmPackages(aRpmPackages),
+ iFullAppName(aAppPrefix + QString("-") + aAppSuffix),
iAppSuffix(aAppSuffix),
iQmlPath(aQmlPath),
+ iTransDir(aTransDir),
iClient(dbus_log_client_new(G_BUS_TYPE_SYSTEM, aService, "/",
- DBUSLOG_CLIENT_FLAG_AUTOSTART)),
-#ifdef OPENREPOS
- iFullAppName(QString("openrepos-logger-") + aAppSuffix),
- iTransDir("/usr/share/translations")
-#else
- iFullAppName(QString("harbour-logger-") + aAppSuffix),
- iTransDir(SailfishApp::pathTo("translations").toLocalFile())
-#endif
+ DBUSLOG_CLIENT_FLAG_AUTOSTART))
{
QString pluginPrefix(QString("harbour.logger.") + aAppSuffix);
register_types(qPrintable(pluginPrefix));
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/.gitignore
^
|
@@ -4,11 +4,14 @@
test/coverage/full.gcov
test/coverage/libglibutil.gcov
test/coverage/results
+debian/.debhelper
debian/files
debian/libglibutil-dev.debhelper.log
+debian/libglibutil-dev.install
debian/libglibutil-dev.substvars
debian/libglibutil-dev
debian/libglibutil.debhelper.log
+debian/libglibutil.install
debian/libglibutil.postinst.debhelper
debian/libglibutil.postrm.debhelper
debian/libglibutil.substvars
|
[-]
[+]
|
Added |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/LICENSE
^
|
@@ -0,0 +1,28 @@
+Copyright (C) 2014-2022 Jolla Ltd.
+
+You may use this file under the terms of BSD license as follows:
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 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 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
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/Makefile
^
|
@@ -20,7 +20,7 @@
VERSION_MAJOR = 1
VERSION_MINOR = 0
-VERSION_RELEASE = 42
+VERSION_RELEASE = 67
# Version for pkg-config
PCVERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
@@ -70,10 +70,8 @@
# Tools and flags
#
-ifndef CC
-CC = $(CROSS_COMPILE)gcc
-endif
-
+CC ?= $(CROSS_COMPILE)gcc
+STRIP ?= strip
LD = $(CC)
WARNINGS = -Wall
INCLUDES = -I$(INCLUDE_DIR)
@@ -86,10 +84,7 @@
RELEASE_FLAGS =
COVERAGE_FLAGS = -g
-ifndef KEEP_SYMBOLS
-KEEP_SYMBOLS = 0
-endif
-
+KEEP_SYMBOLS ?= 0
ifneq ($(KEEP_SYMBOLS),0)
RELEASE_FLAGS += -g
endif
@@ -113,6 +108,8 @@
RELEASE_LIB = $(RELEASE_BUILD_DIR)/$(LIB)
DEBUG_LINK = $(DEBUG_BUILD_DIR)/$(LIB_SYMLINK1)
RELEASE_LINK = $(RELEASE_BUILD_DIR)/$(LIB_SYMLINK1)
+DEBUG_DEV_LINK = $(DEBUG_BUILD_DIR)/$(LIB_DEV_SYMLINK)
+RELEASE_DEV_LINK = $(RELEASE_BUILD_DIR)/$(LIB_DEV_SYMLINK)
DEBUG_STATIC_LIB = $(DEBUG_BUILD_DIR)/$(STATIC_LIB)
RELEASE_STATIC_LIB = $(RELEASE_BUILD_DIR)/$(STATIC_LIB)
COVERAGE_STATIC_LIB = $(COVERAGE_BUILD_DIR)/$(STATIC_LIB)
@@ -137,9 +134,9 @@
# Rules
#
-debug: $(DEBUG_STATIC_LIB) $(DEBUG_LIB) $(DEBUG_LINK)
+debug: $(DEBUG_STATIC_LIB) $(DEBUG_DEV_LINK)
-release: $(RELEASE_STATIC_LIB) $(RELEASE_LIB) $(RELEASE_LINK)
+release: $(RELEASE_STATIC_LIB) $(RELEASE_DEV_LINK)
coverage: $(COVERAGE_STATIC_LIB)
@@ -162,6 +159,7 @@
rm -fr debian/tmp debian/libglibutil debian/libglibutil-dev
rm -f documentation.list debian/files debian/*.substvars
rm -f debian/*.debhelper.log debian/*.debhelper debian/*~
+ rm -fr debian/*.install
test:
make -C test test
@@ -189,21 +187,25 @@
$(DEBUG_LIB): $(DEBUG_OBJS)
$(LD) $(DEBUG_OBJS) $(DEBUG_LDFLAGS) -o $@
- ln -sf $(LIB) $(DEBUG_LINK)
$(RELEASE_LIB): $(RELEASE_OBJS)
$(LD) $(RELEASE_OBJS) $(RELEASE_LDFLAGS) -o $@
- ln -sf $(LIB) $(RELEASE_LINK)
ifeq ($(KEEP_SYMBOLS),0)
- strip $@
+ $(STRIP) $@
endif
-$(DEBUG_LINK):
+$(DEBUG_LINK): $(DEBUG_LIB)
ln -sf $(LIB) $@
-$(RELEASE_LINK):
+$(RELEASE_LINK): $(RELEASE_LIB)
ln -sf $(LIB) $@
+$(DEBUG_DEV_LINK): $(DEBUG_LINK)
+ ln -sf $(LIB_SYMLINK1) $@
+
+$(RELEASE_DEV_LINK): $(RELEASE_LINK)
+ ln -sf $(LIB_SYMLINK1) $@
+
$(DEBUG_STATIC_LIB): $(DEBUG_OBJS)
$(AR) rc $@ $?
@@ -213,8 +215,19 @@
$(COVERAGE_STATIC_LIB): $(COVERAGE_OBJS)
$(AR) rc $@ $?
-$(PKGCONFIG): $(LIB_NAME).pc.in
- sed -e 's/\[version\]/'$(PCVERSION)/g $< > $@
+#
+# LIBDIR usually gets substituted with arch specific dir.
+# It's relative in deb build and can be whatever in rpm build.
+#
+
+LIBDIR ?= usr/lib
+ABS_LIBDIR := $(shell echo /$(LIBDIR) | sed -r 's|/+|/|g')
+
+$(PKGCONFIG): $(LIB_NAME).pc.in Makefile
+ sed -e 's|@version@|$(PCVERSION)|g' -e 's|@libdir@|$(ABS_LIBDIR)|g' $< > $@
+
+debian/%.install: debian/%.install.in
+ sed 's|@LIBDIR@|$(LIBDIR)|g' $< > $@
#
# Install
@@ -226,12 +239,19 @@
INSTALL_DIRS = $(INSTALL) -d
INSTALL_FILES = $(INSTALL) -m $(INSTALL_PERM)
-INSTALL_LIB_DIR = $(DESTDIR)/usr/lib
+INSTALL_LIB_DIR = $(DESTDIR)$(ABS_LIBDIR)
INSTALL_INCLUDE_DIR = $(DESTDIR)/usr/include/gutil
-INSTALL_PKGCONFIG_DIR = $(DESTDIR)/usr/lib/pkgconfig
+INSTALL_PKGCONFIG_DIR = $(DESTDIR)$(ABS_LIBDIR)/pkgconfig
+#
+# rpm based systems expect libraries to be 755
+# deb based systems expect libraries to be 644
+#
+# 755 works for both because dh_fixperms removes execute permissions
+# from any libraries and other files that don't need it.
+#
install: $(INSTALL_LIB_DIR)
- $(INSTALL_FILES) $(RELEASE_LIB) $(INSTALL_LIB_DIR)
+ $(INSTALL) -m 755 $(RELEASE_LIB) $(INSTALL_LIB_DIR)
ln -sf $(LIB) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK2)
ln -sf $(LIB_SYMLINK2) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK1)
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/debian/changelog
^
|
@@ -1,3 +1,161 @@
+libglibutil (1.0.67) unstable; urgency=low
+
+ * Added gutil_log_dump_bytes()
+
+ -- Slava Monich <slava.monich@jolla.com> Fri, 15 Jul 2022 03:02:33 +0300
+
+libglibutil (1.0.66) unstable; urgency=low
+
+ * Bumped debhelper compat level to 7
+
+ -- Slava Monich <slava.monich@jolla.com> Fri, 15 Jul 2022 03:02:33 +0300
+
+libglibutil (1.0.65) unstable; urgency=low
+
+ * Fixed a Musl compatibility issue
+
+ -- Slava Monich <slava.monich@jolla.com> Thu, 16 Jun 2022 02:12:22 +0300
+
+libglibutil (1.0.64) unstable; urgency=low
+
+ * Resolved a mysterious parallel build issue
+
+ -- Slava Monich <slava.monich@jolla.com> Tue, 17 May 2022 03:56:50 +0300
+
+libglibutil (1.0.63) unstable; urgency=low
+
+ * Added gutil_bytes_has_prefix()
+ * Added gutil_bytes_has_suffix()
+
+ -- Slava Monich <slava.monich@jolla.com> Sat, 23 Apr 2022 21:24:25 +0300
+
+libglibutil (1.0.62) unstable; urgency=low
+
+ * Added gutil_strlen0()
+ * Added gutil_strv_find_last()
+ * Added gutil_strv_remove_dups()
+
+ -- Slava Monich <slava.monich@jolla.com> Sun, 13 Mar 2022 21:59:26 +0200
+
+libglibutil (1.0.61) unstable; urgency=low
+
+ * Added gutil_strv_remove()
+
+ -- Slava Monich <slava.monich@jolla.com> Thu, 25 Nov 2021 18:31:18 +0200
+
+libglibutil (1.0.60) unstable; urgency=low
+
+ * Housekeeping release
+
+ -- Slava Monich <slava.monich@jolla.com> Mon, 22 Nov 2021 23:37:14 +0200
+
+libglibutil (1.0.58) unstable; urgency=low
+
+ * Don't check upper bound when setting log level from the envvironment
+
+ -- Slava Monich <slava.monich@jolla.com> Wed, 17 Nov 2021 13:17:45 +0200
+
+libglibutil (1.0.57) unstable; urgency=low
+
+ * Fixed unit tests for older 32-bit systems
+
+ -- Slava Monich <slava.monich@jolla.com> Mon, 08 Nov 2021 02:28:37 +0200
+
+libglibutil (1.0.56) unstable; urgency=low
+
+ * Added gutil_parse_int64()
+ * Added gutil_parse_uint64()
+
+ -- Slava Monich <slava.monich@jolla.com> Sun, 03 Oct 2021 20:18:15 +0300
+
+libglibutil (1.0.55) unstable; urgency=low
+
+ * Added gutil_log_dump()
+ * Added gutil_range_init_with_bytes()
+ * Added gutil_range_has_prefix()
+ * Added gutil_range_skip_prefix()
+
+ -- Slava Monich <slava.monich@jolla.com> Sun, 23 May 2021 03:33:58 +0300
+
+libglibutil (1.0.54) unstable; urgency=low
+
+ * Added GUtilRange type
+ * Tweaked interpretation of environment variables
+
+ -- Slava Monich <slava.monich@jolla.com> Mon, 17 May 2021 16:06:25 +0300
+
+libglibutil (1.0.53) unstable; urgency=low
+
+ * Optimized gutil_parse_int()
+ * Added gutil_parse_uint()
+
+ -- Slava Monich <slava.monich@jolla.com> Wed, 05 May 2021 15:30:57 +0300
+
+libglibutil (1.0.52) unstable; urgency=low
+
+ * Added gutil_memdup()
+
+ -- Slava Monich <slava.monich@jolla.com> Sun, 18 Apr 2021 17:40:41 +0300
+
+libglibutil (1.0.51) unstable; urgency=low
+
+ * Initialize default log settings from the environment
+ * Disable timestamps by default
+ * Added gutil_log_tid option
+ * Added gutil_ptrv_free()
+
+ -- Slava Monich <slava.monich@jolla.com> Thu, 25 Feb 2021 19:36:05 +0200
+
+libglibutil (1.0.50) unstable; urgency=low
+
+ * Added gutil_ptrv_length()
+
+ -- Slava Monich <slava.monich@jolla.com> Wed, 28 Oct 2020 17:59:10 +0200
+
+libglibutil (1.0.49) unstable; urgency=low
+
+ * Added gutil_slice_free() macro
+
+ -- Slava Monich <slava.monich@jolla.com> Sat, 17 Oct 2020 01:01:25 +0300
+
+libglibutil (1.0.48) unstable; urgency=low
+
+ * Make library executable on rpm based systems
+
+ -- Slava Monich <slava.monich@jolla.com> Mon, 31 Aug 2020 00:07:18 +0300
+
+libglibutil (1.0.47) unstable; urgency=low
+
+ * Added gutil_strv_addv()
+
+ -- Slava Monich <slava.monich@jolla.com> Tue, 28 Jul 2020 13:56:08 +0300
+
+libglibutil (1.0.46) unstable; urgency=low
+
+ * Allow STRIP to be defined by the environment
+
+ -- Slava Monich <slava.monich@jolla.com> Sat, 30 May 2020 00:02:35 +0300
+
+libglibutil (1.0.45) unstable; urgency=low
+
+ * Support for multiple archs
+
+ -- Slava Monich <slava.monich@jolla.com> Fri, 22 May 2020 16:11:42 +0300
+
+libglibutil (1.0.44) unstable; urgency=low
+
+ * Adapted to side-by-side linking
+ * Allow overriding CC for unit tests
+
+ -- Slava Monich <slava.monich@jolla.com> Tue, 17 Mar 2020 19:01:45 +0200
+
+libglibutil (1.0.43) unstable; urgency=low
+
+ * Allow specifying per-module logging function
+ * Added default GLogProc2 compatible callbacks
+
+ -- Slava Monich <slava.monich@jolla.com> Fri, 20 Dec 2019 19:31:32 +0200
+
libglibutil (1.0.42) unstable; urgency=low
* Zero-initialize timespec::tv_nsec
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/debian/compat
^
|
@@ -1 +1 @@
-5
+7
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/debian/control
^
|
@@ -2,7 +2,7 @@
Section: libs
Priority: optional
Maintainer: Slava Monich <slava.monich@jolla.com>
-Build-Depends: debhelper (>= 7), libglib2.0-dev (>= 2.0)
+Build-Depends: debhelper (>= 8.1.3), libglib2.0-dev (>= 2.0)
Standards-Version: 3.8.4
Package: libglibutil
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/debian/copyright
^
|
@@ -1,5 +1,4 @@
-Copyright (C) 2014-2015 Jolla Ltd.
-Contact: Slava Monich <slava.monich@jolla.com>
+Copyright (C) 2014-2022 Jolla Ltd.
You may use this file under the terms of BSD license as follows:
@@ -12,9 +11,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 the 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
|
[-]
[+]
|
Added |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/debian/libglibutil-dev.install.in
^
|
@@ -0,0 +1,3 @@
+debian/tmp/@LIBDIR@/libglibutil.so @LIBDIR@
+debian/tmp/@LIBDIR@/pkgconfig/libglibutil.pc @LIBDIR@/pkgconfig
+debian/tmp/usr/include/* usr/include/
|
[-]
[+]
|
Added |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/debian/libglibutil.install.in
^
|
@@ -0,0 +1 @@
+debian/tmp/@LIBDIR@/libglibutil.so.* @LIBDIR@
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/debian/rules
^
|
@@ -4,8 +4,13 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
+LIBDIR=usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+override_dh_auto_build:
+ dh_auto_build -- LIBDIR=$(LIBDIR) release pkgconfig debian/libglibutil.install debian/libglibutil-dev.install
+
override_dh_auto_install:
- dh_auto_install -- install-dev
+ dh_auto_install -- LIBDIR=$(LIBDIR) install-dev
%:
dh $@
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/include/gutil_log.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2014-2018 Jolla Ltd.
- * Copyright (C) 2014-2018 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2014-2022 Jolla Ltd.
+ * Copyright (C) 2014-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -14,8 +14,8 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 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.
+ * 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
@@ -75,11 +75,19 @@
# endif
#endif
+/* Logging function prototypes */
+#define GUTIL_DEFINE_LOG_FN(fn) void fn(const char* name, int level, \
+ const char* format, va_list va)
+#define GUTIL_DEFINE_LOG_FN2(fn) void fn(const GLogModule* module, \
+ int level, const char* format, va_list va)
+typedef GUTIL_DEFINE_LOG_FN((*GLogProc));
+typedef GUTIL_DEFINE_LOG_FN2((*GLogProc2));
+
/* Log module */
struct glog_module {
const char* name; /* Name (used as prefix) */
const GLogModule* parent; /* Parent log module (optional) */
- void* reserved; /* Reserved for future expansion */
+ GLogProc2 log_proc; /* Per-module logging function (1.0.43) */
const int max_level; /* Maximum level defined at compile time */
int level; /* Current log level */
int flags; /* Flags (see below) */
@@ -131,6 +139,21 @@
const char* format,
va_list va);
+void
+gutil_log_dump(
+ const GLogModule* module,
+ int level,
+ const char* prefix,
+ const void* data,
+ gsize size); /* Since 1.0.55 */
+
+void
+gutil_log_dump_bytes(
+ const GLogModule* module,
+ int level,
+ const char* prefix,
+ GBytes* bytes); /* Since 1.0.67 */
+
/* Check if logging is enabled for the specified log level */
gboolean
gutil_log_enabled(
@@ -145,22 +168,21 @@
extern const char GLOG_TYPE_SYSLOG[];
/* Available log handlers */
-#define GUTIL_DEFINE_LOG_FN(fn) void fn(const char* name, int level, \
- const char* format, va_list va)
-#define GUTIL_DEFINE_LOG_FN2(fn) void fn(const GLogModule* module, \
- int level, const char* format, va_list va)
GUTIL_DEFINE_LOG_FN(gutil_log_stdout);
GUTIL_DEFINE_LOG_FN(gutil_log_stderr);
GUTIL_DEFINE_LOG_FN(gutil_log_glib);
GUTIL_DEFINE_LOG_FN(gutil_log_syslog);
+GUTIL_DEFINE_LOG_FN2(gutil_log_stdout2); /* Since 1.0.43 */
+GUTIL_DEFINE_LOG_FN2(gutil_log_stderr2); /* Since 1.0.43 */
+GUTIL_DEFINE_LOG_FN2(gutil_log_glib2); /* Since 1.0.43 */
+GUTIL_DEFINE_LOG_FN2(gutil_log_syslog2); /* Since 1.0.43 */
/* Log configuration */
GLOG_MODULE_DECL(gutil_log_default)
-typedef GUTIL_DEFINE_LOG_FN((*GLogProc));
-typedef GUTIL_DEFINE_LOG_FN2((*GLogProc2));
extern GLogProc gutil_log_func;
extern GLogProc2 gutil_log_func2;
extern gboolean gutil_log_timestamp; /* Only affects stdout and stderr */
+extern gboolean gutil_log_tid; /* Since 1.0.51 */
/* Log module (optional) */
#define GLOG_MODULE_DEFINE_(var,name) \
@@ -311,9 +333,15 @@
GLOG_LEVEL_DEBUG, f, ##args)
# define GDEBUG_(f,args...) gutil_log(GLOG_MODULE_CURRENT, \
GLOG_LEVEL_DEBUG, "%s() " f, __FUNCTION__, ##args)
+# define GDEBUG_DUMP(buf,n) gutil_log_dump(GLOG_MODULE_CURRENT, \
+ GLOG_LEVEL_DEBUG, NULL, buf, n) /* Since 1.0.55 */
+# define GDEBUG_DUMP_BYTES(b) gutil_log_dump_bytes(GLOG_MODULE_CURRENT, \
+ GLOG_LEVEL_DEBUG, NULL, b) /* Since 1.0.67 */
# else
# define GDEBUG(f,args...) GLOG_NOTHING
# define GDEBUG_(f,args...) GLOG_NOTHING
+# define GDEBUG_DUMP(buf,n) GLOG_NOTHING /* Since 1.0.55 */
+# define GDEBUG_DUMP_BYTES(b) GLOG_NOTHING /* Since 1.0.67 */
# endif /* GUTIL_LOG_DEBUG */
#else
# define GDEBUG_ GDEBUG
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/include/gutil_macros.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2014-2015 Jolla Ltd.
- * Contact: Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2014-2020 Jolla Ltd.
+ * Copyright (C) 2014-2020 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 the 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
@@ -48,6 +48,8 @@
# define G_PACKED
#endif
+#define gutil_slice_free(x) g_slice_free1(sizeof(*(x)), x) /* Since 1.0.49 */
+
#endif /* GUTIL_MACROS_H */
/*
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/include/gutil_misc.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2019 Jolla Ltd.
- * Copyright (C) 2016-2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2022 Jolla Ltd.
+ * Copyright (C) 2016-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -70,6 +70,24 @@
int* value); /* Since 1.0.30 */
gboolean
+gutil_parse_uint(
+ const char* str,
+ int base,
+ unsigned int* value); /* Since 1.0.53 */
+
+gboolean
+gutil_parse_int64(
+ const char* str,
+ int base,
+ gint64* value); /* Since 1.0.56 */
+
+gboolean
+gutil_parse_uint64(
+ const char* str,
+ int base,
+ guint64* value); /* Since 1.0.56 */
+
+gboolean
gutil_data_equal(
const GUtilData* data1,
const GUtilData* data2); /* Since 1.0.31 */
@@ -117,6 +135,50 @@
GBytes* bytes,
const GUtilData* data); /* Since 1.0.41 */
+gboolean
+gutil_bytes_has_prefix(
+ GBytes* bytes,
+ const void* data,
+ gsize size); /* Since 1.0.63 */
+
+gboolean
+gutil_bytes_has_suffix(
+ GBytes* bytes,
+ const void* data,
+ gsize size); /* Since 1.0.63 */
+
+gsize
+gutil_ptrv_length(
+ const void* ptrv); /* Since 1.0.50 */
+
+void
+gutil_ptrv_free(
+ void** ptrv); /* Since 1.0.51 */
+
+void*
+gutil_memdup(
+ const void* ptr,
+ gsize size); /* Since 1.0.52 */
+
+gsize
+gutil_strlen0(
+ const char* str); /* Since 1.0.62 */
+
+gsize
+gutil_range_init_with_bytes(
+ GUtilRange* range,
+ GBytes* bytes); /* Since 1.0.55 */
+
+gboolean
+gutil_range_has_prefix(
+ const GUtilRange* range,
+ const GUtilData* prefix); /* Since 1.0.55 */
+
+gboolean
+gutil_range_skip_prefix(
+ GUtilRange* range,
+ const GUtilData* prefix); /* Since 1.0.55 */
+
G_END_DECLS
#endif /* GUTIL_MISC_H */
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/include/gutil_strv.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2014-2019 Jolla Ltd.
- * Copyright (C) 2014-2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2014-2022 Jolla Ltd.
+ * Copyright (C) 2014-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -69,6 +69,15 @@
const char* s);
/**
+ * Returns index of the last occurrence of specified string in the string
+ * array, or -1 if the string is not found.
+ */
+int
+gutil_strv_find_last(
+ const GStrV* sv,
+ const char* s); /* Since 1.0.62 */
+
+/**
* Checks if string array contains the specified string.
*/
gboolean
@@ -82,7 +91,19 @@
GStrV*
gutil_strv_add(
GStrV* sv,
- const char* s);
+ const char* s)
+ G_GNUC_WARN_UNUSED_RESULT;
+
+/**
+ * Appends new string(s) to the array.
+ */
+GStrV*
+gutil_strv_addv(
+ GStrV* sv,
+ const char* s,
+ ...) /* Since 1.0.47 */
+ G_GNUC_WARN_UNUSED_RESULT
+ G_GNUC_NULL_TERMINATED;
/**
* Removes the string from the specified position in the array.
@@ -91,7 +112,21 @@
gutil_strv_remove_at(
GStrV* sv,
int pos,
- gboolean free_string);
+ gboolean free_string)
+ G_GNUC_WARN_UNUSED_RESULT;
+
+/**
+ * Removes one or all matching strings from the array and frees them.
+ */
+GStrV*
+gutil_strv_remove(
+ GStrV* sv,
+ const char* s,
+ gboolean remove_all) /* Since 1.0.61 */
+ G_GNUC_WARN_UNUSED_RESULT;
+
+#define gutil_strv_remove_one(sv, s) gutil_strv_remove(sv, s, FALSE)
+#define gutil_strv_remove_all(sv, s) gutil_strv_remove(sv, s, TRUE)
/**
* Checks two string arrays for equality.
@@ -102,6 +137,13 @@
const GStrV* sv2);
/**
+ * Removes all duplicates from the string array.
+ */
+GStrV*
+gutil_strv_remove_dups(
+ GStrV* sv); /* Since 1.0.62 */
+
+/**
* Sorts the string array
*/
GStrV*
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/include/gutil_types.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2014-2018 Jolla Ltd.
- * Copyright (C) 2014-2018 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2014-2021 Jolla Ltd.
+ * Copyright (C) 2014-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -14,8 +14,8 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 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.
+ * 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
@@ -54,6 +54,11 @@
gsize size;
} GUtilData;
+typedef struct gutil_range {
+ const guint8* ptr;
+ const guint8* end;
+} GUtilRange; /* Since 1.0.54 */
+
#define GLOG_MODULE_DECL(m) extern GLogModule m;
typedef struct glog_module GLogModule;
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/libglibutil.pc.in
^
|
@@ -1,10 +1,10 @@
name=glibutil
-libdir=/usr/lib
+libdir=@libdir@
includedir=/usr/include
Name: libglibutil
Description: Library of glib utilities
-Version: [version]
+Version: @version@
Requires.private: glib-2.0
Libs: -L${libdir} -l${name}
Cflags: -I${includedir} -I${includedir}/gutil
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/rpm/libglibutil.spec
^
|
@@ -1,12 +1,19 @@
Name: libglibutil
-Version: 1.0.42
+
+Version: 1.0.67
Release: 0
Summary: Library of glib utilities
-Group: Development/Libraries
License: BSD
-URL: https://git.sailfishos.org/mer-core/libglibutil
+URL: https://github.com/sailfishos/libglibutil
Source: %{name}-%{version}.tar.bz2
+
+BuildRequires: pkgconfig
BuildRequires: pkgconfig(glib-2.0)
+
+# license macro requires rpm >= 4.11
+BuildRequires: pkgconfig(rpm)
+%define license_support %(pkg-config --exists 'rpm >= 4.11'; echo $?)
+
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
@@ -16,7 +23,6 @@
%package devel
Summary: Development library for %{name}
Requires: %{name} = %{version}
-Requires: pkgconfig
%description devel
This package contains the development library for %{name}.
@@ -25,11 +31,11 @@
%setup -q
%build
-make KEEP_SYMBOLS=1 release pkgconfig
+make %{_smp_mflags} LIBDIR=%{_libdir} KEEP_SYMBOLS=1 release pkgconfig
%install
rm -rf %{buildroot}
-make install-dev DESTDIR=%{buildroot}
+make LIBDIR=%{_libdir} DESTDIR=%{buildroot} install-dev
%check
make -C test test
@@ -41,6 +47,9 @@
%files
%defattr(-,root,root,-)
%{_libdir}/%{name}.so.*
+%if %{license_support} == 0
+%license LICENSE
+%endif
%files devel
%defattr(-,root,root,-)
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/src/gutil_idlepool.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2018 Jolla Ltd.
- * Copyright (C) 2016-2018 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2020 Jolla Ltd.
+ * Copyright (C) 2016-2020 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -14,8 +14,8 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 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.
+ * 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
@@ -31,6 +31,7 @@
*/
#include <gutil_idlepool.h>
+#include <gutil_macros.h>
#include <gutil_log.h>
#include <glib-object.h>
@@ -103,7 +104,7 @@
/* Clear pointer to the shared instance */
if (self->shared) *(self->shared) = NULL;
gutil_idle_pool_drain(self);
- g_slice_free(GUtilIdlePool, self);
+ gutil_slice_free(self);
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/src/gutil_idlequeue.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2017 Jolla Ltd.
- * Contact: Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2017-2020 Jolla Ltd.
+ * Copyright (C) 2017-2020 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
@@ -31,6 +31,7 @@
*/
#include "gutil_idlequeue.h"
+#include "gutil_macros.h"
#include "gutil_log.h"
typedef struct gutil_idle_queue_item GUtilIdleQueueItem;
@@ -60,7 +61,7 @@
if (item->destroy) {
item->destroy(item->data);
}
- g_slice_free(GUtilIdleQueueItem, item);
+ gutil_slice_free(item);
}
static
@@ -151,7 +152,7 @@
GASSERT(q->ref_count > 0);
if (g_atomic_int_dec_and_test(&q->ref_count)) {
gutil_idle_queue_cancel_all(q);
- g_slice_free(GUtilIdleQueue, q);
+ gutil_slice_free(q);
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/src/gutil_ints.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2017 Jolla Ltd.
- * Contact: Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2017-2021 Jolla Ltd.
+ * Copyright (C) 2017-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
@@ -32,6 +32,8 @@
#include "gutil_intarray.h"
#include "gutil_ints.h"
+#include "gutil_misc.h"
+#include "gutil_macros.h"
struct gutil_ints {
const int* data;
@@ -44,10 +46,10 @@
GUtilInts*
gutil_ints_new(
const int* data,
- guint count)
+ guint n)
{
- if (data && count) {
- return gutil_ints_new_take(g_memdup(data, count*sizeof(int)), count);
+ if (data && n) {
+ return gutil_ints_new_take(gutil_memdup(data, n * sizeof(int)), n);
} else {
return NULL;
}
@@ -134,7 +136,7 @@
if (ints->free_func) {
ints->free_func(ints->user_data);
}
- g_slice_free(GUtilInts, ints);
+ gutil_slice_free(ints);
}
}
}
@@ -154,12 +156,12 @@
/* We can allow the caller to free the data */
result = (int*)ints->data;
} else {
- result = g_memdup(ints->data, ints->count * sizeof(int));
+ result = gutil_memdup(ints->data, ints->count * sizeof(int));
ints->free_func(ints->user_data);
}
- g_slice_free(GUtilInts, ints);
+ gutil_slice_free(ints);
} else {
- result = g_memdup(ints->data, ints->count * sizeof(int));
+ result = gutil_memdup(ints->data, ints->count * sizeof(int));
}
return result;
} else {
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/src/gutil_log.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2014-2019 Jolla Ltd.
- * Copyright (C) 2014-2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2014-2022 Jolla Ltd.
+ * Copyright (C) 2014-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -14,8 +14,8 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 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.
+ * 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
@@ -31,9 +31,17 @@
*/
#include "gutil_log.h"
+#include "gutil_misc.h"
-#if defined(DEBUG) && defined(_WIN32)
+#include <stdlib.h>
+
+#ifdef unix
+# include <unistd.h>
+# include <sys/syscall.h>
+# define gettid() ((int)syscall(SYS_gettid))
+#elif defined(_WIN32)
# include <windows.h>
+# define gettid() ((int)GetCurrentThreadId())
#endif
#ifndef GLOG_SYSLOG
@@ -49,7 +57,10 @@
#endif /* GLOG_GLIB */
/* Allows timestamps in stdout log */
-gboolean gutil_log_timestamp = TRUE;
+gboolean gutil_log_timestamp = FALSE;
+
+/* Adds thread id prefix */
+gboolean gutil_log_tid = FALSE; /* Since 1.0.51 */
/* Log configuration */
static GUTIL_DEFINE_LOG_FN2(gutil_log_default_proc);
@@ -58,7 +69,7 @@
GLogModule gutil_log_default = {
NULL, /* name */
NULL, /* parent */
- NULL, /* reserved */
+ NULL, /* log_proc */
GLOG_LEVEL_MAX, /* max_level */
GLOG_LEVEL_DEFAULT, /* level */
0, /* flags */
@@ -191,8 +202,18 @@
}
#endif
if (name) {
+#ifdef gettid
+ if (gutil_log_tid)
+ fprintf(out, "[%d] %s[%s] %s%s\n", gettid(), t, name, prefix, msg);
+ else
+#endif
fprintf(out, "%s[%s] %s%s\n", t, name, prefix, msg);
} else {
+#ifdef gettid
+ if (gutil_log_tid)
+ fprintf(out, "[%d] %s%s%s\n", gettid(), t, prefix, msg);
+ else
+#endif
fprintf(out, "%s%s%s\n", t, prefix, msg);
}
if (msg != buf) g_free(msg);
@@ -218,6 +239,26 @@
gutil_log_stdio(stderr, name, level, format, va);
}
+void
+gutil_log_stdout2(
+ const GLogModule* module,
+ int level,
+ const char* format,
+ va_list va) /* Since 1.0.43 */
+{
+ gutil_log_stdout(module ? module->name : NULL, level, format, va);
+}
+
+void
+gutil_log_stderr2(
+ const GLogModule* module,
+ int level,
+ const char* format,
+ va_list va) /* Since 1.0.43 */
+{
+ gutil_log_stderr(module ? module->name : NULL, level, format, va);
+}
+
/* Formards output to syslog */
#if GLOG_SYSLOG
#include <syslog.h>
@@ -260,13 +301,27 @@
}
}
- if (name || prefix) {
+ if (name || prefix
+#ifdef gettid
+ || gutil_log_tid
+#endif
+ ) {
char buf[512];
char* msg = gutil_log_format(buf, sizeof(buf), format, va);
if (!prefix) prefix = "";
if (name) {
+#ifdef gettid
+ if (gutil_log_tid)
+ syslog(priority, "[%d] [%s] %s%s", gettid(), name, prefix, msg);
+ else
+#endif
syslog(priority, "[%s] %s%s", name, prefix, msg);
} else {
+#ifdef gettid
+ if (gutil_log_tid)
+ syslog(priority, "[%d] %s%s", gettid(), prefix, msg);
+ else
+#endif
syslog(priority, "%s%s", prefix, msg);
}
if (msg != buf) g_free(msg);
@@ -274,6 +329,16 @@
vsyslog(priority, format, va);
}
}
+
+void
+gutil_log_syslog2(
+ const GLogModule* module,
+ int level,
+ const char* format,
+ va_list va) /* Since 1.0.43 */
+{
+ gutil_log_syslog(module ? module->name : NULL, level, format, va);
+}
#endif /* GLOG_SYSLOG */
/* Forwards output to g_logv */
@@ -296,6 +361,16 @@
}
g_logv(name, flags, format, va);
}
+
+void
+gutil_log_glib2(
+ const GLogModule* module,
+ int level,
+ const char* format,
+ va_list va) /* Since 1.0.43 */
+{
+ gutil_log_glib(module ? module->name : NULL, level, format, va);
+}
#endif /* GLOG_GLIB */
/**
@@ -336,11 +411,11 @@
check->level : gutil_log_default.level;
if ((level > GLOG_LEVEL_NONE && level <= max_level) ||
(level == GLOG_LEVEL_ALWAYS)) {
- GLogProc2 log = gutil_log_func2;
- if (G_LIKELY(log)) {
- if (!module) module = &gutil_log_default;
- log(module, level, format, va);
- }
+ GLogProc2 log;
+ /* Caller makes sure that at least gutil_log_func2 is there */
+ if (!module) module = &gutil_log_default;
+ log = module->log_proc ? module->log_proc : gutil_log_func2;
+ log(module, level, format, va);
}
}
}
@@ -415,6 +490,56 @@
return FALSE;
}
+static
+void
+gutil_log_dump2(
+ const GLogModule* module,
+ int level,
+ const char* prefix,
+ const void* data,
+ gsize size)
+{
+ const guint8* ptr = data;
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/src/gutil_misc.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2019 Jolla Ltd.
- * Copyright (C) 2016-2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2022 Jolla Ltd.
+ * Copyright (C) 2016-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -35,8 +35,8 @@
#include <glib-object.h>
#include <ctype.h>
-#include <limits.h>
#include <errno.h>
+#include <limits.h>
void
gutil_disconnect_handlers(
@@ -46,6 +46,7 @@
{
if (G_LIKELY(instance) && G_LIKELY(ids)) {
int i;
+
for (i=0; i<count; i++) {
if (ids[i]) {
g_signal_handler_disconnect(instance, ids[i]);
@@ -64,6 +65,7 @@
if (str && data && len > 0 && !(len & 1)) {
gssize i;
guint8* ptr = data;
+
for (i=0; i<len; i+=2) {
static const guint8 hex[] = {
0, 1, 2, 3, 4, 5, 6, 7, /* 0x30..0x37 */
@@ -76,7 +78,8 @@
};
const char x1 = str[i];
const char x2 = str[i+1];
- if (isxdigit(x1) && isxdigit(x2)) {
+
+ if (g_ascii_isxdigit(x1) && g_ascii_isxdigit(x2)) {
*ptr++ = (hex[x1-0x30] << 4) + hex[x2-0x30];
} else {
return NULL;
@@ -95,9 +98,11 @@
if (str) {
if (len < 0) len = strlen(str);
if (len > 0 && !(len & 1)) {
- void* data = g_malloc(len/2);
+ const gsize n = len/2;
+ void* data = g_malloc(n);
+
if (gutil_hex2bin(str, len, data)) {
- return g_bytes_new_take(data, len/2);
+ return g_bytes_new_take(data, n);
}
g_free(data);
}
@@ -153,36 +158,127 @@
return bytes_dumped;
}
-/* Since 1.0.30 */
+static
+const char*
+gutil_strstrip(
+ const char* str,
+ char** tmp)
+{
+ /* Caller makes sure that str isn't NULL */
+ const gsize len = strlen(str);
+
+ if (g_ascii_isspace(str[0]) || g_ascii_isspace(str[len - 1])) {
+ /* Need to modify the original string */
+ return (*tmp = g_strstrip(gutil_memdup(str, len + 1)));
+ } else {
+ /* The original string is fine as is */
+ return str;
+ }
+}
+
gboolean
gutil_parse_int(
const char* str,
int base,
- int* value)
+ int* value) /* Since 1.0.30 */
+{
+ gint64 ll;
+
+ if (gutil_parse_int64(str, base, &ll) && ll >= INT_MIN && ll <= INT_MAX) {
+ if (value) {
+ *value = (int)ll;
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+gboolean
+gutil_parse_uint(
+ const char* str,
+ int base,
+ unsigned int* value) /* Since 1.0.53 */
+{
+ guint64 ull;
+
+ if (gutil_parse_uint64(str, base, &ull) && ull <= UINT_MAX) {
+ if (value) {
+ *value = (unsigned int)ull;
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+gboolean
+gutil_parse_int64(
+ const char* str,
+ int base,
+ gint64* value) /* Since 1.0.56 */
{
gboolean ok = FALSE;
- if (str && str[0]) {
- char* str2 = g_strstrip(g_strdup(str));
- char* end = str2;
- gint64 l;
+ if (str && *str) {
+ char* tmp = NULL;
+ char* end = NULL;
+ const char* stripped = gutil_strstrip(str, &tmp);
+ gint64 ll;
errno = 0;
- l = g_ascii_strtoll(str2, &end, base);
- ok = !*end && errno != ERANGE && l >= INT_MIN && l <= INT_MAX;
- if (ok && value) {
- *value = (int)l;
+ ll = g_ascii_strtoll(stripped, &end, base);
+ if (end && !*end &&
+ !((ll == G_MAXINT64 || ll == G_MININT64) && errno == ERANGE) &&
+ !(ll == 0 && errno == EINVAL)) {
+ if (value) {
+ *value = ll;
+ }
+ ok = TRUE;
}
- g_free(str2);
+ g_free(tmp);
+ }
+ return ok;
+}
+
+gboolean
+gutil_parse_uint64(
+ const char* str,
+ int base,
+ guint64* value) /* Since 1.0.56 */
+{
+ gboolean ok = FALSE;
+
+ /*
+ * Sorry, we don't accept minus as a part of an unsigned number
+ * (unlike strtoul)
+ */
+ if (str && *str && *str != '-') {
+ char* tmp = NULL;
+ const char* stripped = gutil_strstrip(str, &tmp);
+
+ if (*stripped != '-') {
+ char* end = NULL;
+ guint64 ull;
+
+ errno = 0;
+ ull = g_ascii_strtoull(stripped, &end, base);
+ if (end && !*end &&
+ !(ull == G_MAXUINT64 && errno == ERANGE) &&
+ !(ull == 0 && errno == EINVAL)) {
+ if (value) {
+ *value = ull;
+ }
+ ok = TRUE;
+ }
+ }
+ g_free(tmp);
}
return ok;
}
-/* since 1.0.31 */
gboolean
gutil_data_equal(
const GUtilData* data1,
- const GUtilData* data2)
+ const GUtilData* data2) /* Since 1.0.31 */
{
if (data1 == data2) {
return TRUE;
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/src/gutil_ring.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016 Jolla Ltd.
- * Contact: Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2020 Jolla Ltd.
+ * Copyright (C) 2016-2020 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 the 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
@@ -31,6 +31,7 @@
*/
#include "gutil_ring.h"
+#include "gutil_macros.h"
#include "gutil_log.h"
struct gutil_ring {
@@ -101,7 +102,7 @@
}
}
g_free(r->data);
- g_slice_free(GUtilRing, r);
+ gutil_slice_free(r);
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/src/gutil_strv.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2014-2019 Jolla Ltd.
- * Copyright (C) 2014-2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2014-2022 Jolla Ltd.
+ * Copyright (C) 2014-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -31,6 +31,7 @@
*/
#include "gutil_strv.h"
+#include "gutil_misc.h"
#include <stdlib.h>
@@ -41,13 +42,7 @@
gutil_strv_length(
const GStrV* sv)
{
- if (G_LIKELY(sv)) {
- guint i = 0;
- while (sv[i]) i++;
- return i;
- } else {
- return 0;
- }
+ return (guint) gutil_ptrv_length(sv);
}
/**
@@ -93,9 +88,10 @@
const GStrV* sv,
const char* s)
{
- if (sv && s) {
+ if (G_LIKELY(sv) && G_LIKELY(s)) {
int i = 0;
const GStrV* ptr;
+
for (ptr = sv; *ptr; ptr++, i++) {
if (!strcmp(*ptr, s)) {
return i;
@@ -105,6 +101,36 @@
return -1;
}
+/* Helper for gutil_strv_find_last and friends */
+static
+int
+gutil_strv_find_last_impl(
+ const GStrV* sv,
+ const char* s,
+ int i /* exclisive */)
+{
+ while (i > 0) {
+ if (!strcmp(sv[--i], s)) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+/**
+ * Returns index of the last occurrence of specified string in the string
+ * array, or -1 if the string is not found.
+ */
+int
+gutil_strv_find_last(
+ const GStrV* sv,
+ const char* s) /* Since 1.0.62 */
+{
+ /* NULL sv is handled by gutil_strv_length() */
+ return G_LIKELY(s) ? gutil_strv_find_last_impl(sv, s,
+ gutil_strv_length(sv)) : -1;
+}
+
/**
* Checks if string array contains the specified string.
*/
@@ -125,14 +151,58 @@
const char* s)
{
if (s) {
- const guint len = gutil_strv_length(sv);
- GStrV* newsv = g_realloc(sv, sizeof(char*)*(len+2));
- newsv[len] = g_strdup(s);
- newsv[len+1] = NULL;
- return newsv;
- } else {
- return sv;
+ guint len = gutil_strv_length(sv);
+
+ sv = g_renew(char*, sv, len + 2);
+ sv[len++] = g_strdup(s);
+ sv[len] = NULL;
}
+ return sv;
+}
+
+/**
+ * Appends new strings to the array.
+ */
+GStrV*
+gutil_strv_addv(
+ GStrV* sv,
+ const char* s,
+ ...)
+{
+ if (s) {
+ va_list va;
+ const char* s1;
+ guint len, i, n;
+
+ va_start(va, s);
+ for (n = 1; (s1 = va_arg(va, char*)) != NULL; n++);
+ va_end(va);
+
+ len = gutil_strv_length(sv);
+ sv = g_renew(gchar*, sv, len + n + 1);
+ sv[len++] = g_strdup(s);
+ va_start(va, s);
+ for (i = 1; i < n; i++) sv[len++] = g_strdup(va_arg(va, char*));
+ va_end(va);
+ sv[len] = NULL;
+ }
+ return sv;
+}
+
+/* Internal helper for removal functions */
+static
+GStrV*
+gutil_strv_remove_impl(
+ GStrV* sv,
+ guint pos,
+ guint len,
+ gboolean free_string)
+{
+ if (free_string) {
+ g_free(sv[pos]);
+ }
+ memmove(sv + pos, sv + pos + 1, sizeof(char*)*(len - pos));
+ return g_realloc(sv, sizeof(char*)*len);
}
/**
@@ -146,15 +216,66 @@
{
if (G_LIKELY(sv) && G_LIKELY(pos >= 0)) {
const int len = gutil_strv_length(sv);
+
if (pos < len) {
- if (free_string) {
- g_free(sv[pos]);
+ sv = gutil_strv_remove_impl(sv, pos, len, free_string);
+ }
+ }
+ return sv;
+}
+
+/**
+ * Removes one or all matching strings from the array and frees them.
+ */
+GStrV*
+gutil_strv_remove(
+ GStrV* sv,
+ const char* s,
+ gboolean remove_all)
+{
+ if (G_LIKELY(sv) && G_LIKELY(s)) {
+ const int pos = gutil_strv_find(sv, s);
+
+ if (pos >= 0) {
+ guint len = gutil_strv_length(sv);
+
+ sv = gutil_strv_remove_impl(sv, pos, len, TRUE);
+ if (remove_all) {
+ int i, l;
+
+ len--;
+ l = len - pos;
+ while ((i = gutil_strv_find_last_impl(sv + pos, s, l)) >= 0) {
+ sv = gutil_strv_remove_impl(sv, pos + i, len--, TRUE);
+ l = i;
+ }
}
- if (pos < len-1) {
- memmove(sv + pos, sv + pos + 1, sizeof(char*)*(len-pos-1));
+ }
+ }
+ return sv;
+}
+
+/**
+ * Removes all duplicates from the string array.
+ */
+GStrV*
+gutil_strv_remove_dups(
+ GStrV* sv) /* Since 1.0.62 */
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/test/common/Makefile
^
|
@@ -41,7 +41,7 @@
# Tools and flags
#
-CC = $(CROSS_COMPILE)gcc
+CC ?= $(CROSS_COMPILE)gcc
LD = $(CC)
WARNINGS = -Wall
INCLUDES = -I$(LIB_DIR)/include -I$(LIB_DIR)/src -I$(COMMON_DIR)
@@ -52,7 +52,7 @@
$(shell pkg-config --cflags $(PKGS))
FULL_LDFLAGS = $(BASE_LDFLAGS)
LIBS = $(shell pkg-config --libs $(PKGS))
-QUIET_MAKE = make --no-print-directory
+QUIET_MAKE = $(MAKE) --no-print-directory
DEBUG_FLAGS = -g
RELEASE_FLAGS =
COVERAGE_FLAGS = -g
@@ -134,7 +134,7 @@
rm -fr $(BUILD_DIR)
cleaner: clean
- @make -C $(LIB_DIR) clean
+ @$(MAKE) -C $(LIB_DIR) clean
test_banner:
@echo "===========" $(EXE) "=========== "
@@ -185,10 +185,10 @@
$(LD) $(COVERAGE_LDFLAGS) $(COVERAGE_OBJS) $< $(LIBS) -o $@
debug_lib:
- @make $(SUBMAKE_OPTS) -C $(LIB_DIR) debug
+ @$(MAKE) $(SUBMAKE_OPTS) -C $(LIB_DIR) debug
release_lib:
- @make $(SUBMAKE_OPTS) -C $(LIB_DIR) release
+ @$(MAKE) $(SUBMAKE_OPTS) -C $(LIB_DIR) release
coverage_lib:
- @make $(SUBMAKE_OPTS) -C $(LIB_DIR) coverage
+ @$(MAKE) $(SUBMAKE_OPTS) -C $(LIB_DIR) coverage
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/test/common/test_common.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2018 Jolla Ltd.
- * Copyright (C) 2016-2018 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2022 Jolla Ltd.
+ * Copyright (C) 2016-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -14,8 +14,8 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 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.
+ * 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
@@ -58,6 +58,7 @@
/* Macros */
#define TEST_INIT_DATA(a,b) ((a).bytes = (void*)(b), (a).size = sizeof(b))
+#define TEST_ARRAY_AND_SIZE(a) (a), sizeof(a)
#endif /* TEST_COMMON_H */
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/test/test_log/Makefile
^
|
@@ -1,5 +1,6 @@
# -*- Mode: makefile-gmake -*-
+CFLAGS += -DGLOG_LEVEL_MAX=GLOG_LEVEL_VERBOSE
EXE = test_log
include ../common/Makefile
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/test/test_log/test_log.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2017-2019 Jolla Ltd.
- * Copyright (C) 2017-2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2017-2022 Jolla Ltd.
+ * Copyright (C) 2017-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -14,8 +14,8 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 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.
+ * 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
@@ -30,35 +30,37 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef linux
-# define _GNU_SOURCE /* for fopencookie */
-# define HAVE_TEST_LOG_FILE
-#endif
+#define _GNU_SOURCE /* for fopencookie */
#include "test_common.h"
#include "gutil_strv.h"
#include "gutil_log.h"
-static TestOpt test_opt;
-
-/*==========================================================================*
- * Basic
- *==========================================================================*/
+#ifdef __GLIBC__
+/* glibc has writeable stdout */
+# define HAVE_TEST_LOG_FILE
+#endif
-static GString* test_log_basic_buf;
+static TestOpt test_opt;
+static GString* test_log_buf;
static
void
-test_log_basic_fn(
+test_log_fn(
const char* name,
int level,
const char* format,
va_list va)
{
- g_string_append_vprintf(test_log_basic_buf, format, va);
+ g_string_append_vprintf(test_log_buf, format, va);
+ g_string_append_c(test_log_buf, '\n');
}
+/*==========================================================================*
+ * Basic
+ *==========================================================================*/
+
static
void
test_log_basic(
@@ -68,8 +70,8 @@
const GLogProc2 fn2 = gutil_log_func2;
const int level = gutil_log_default.level;
GLOG_MODULE_DEFINE2_(module, "test", gutil_log_default);
- test_log_basic_buf = g_string_new(NULL);
- gutil_log_func = test_log_basic_fn;
+ test_log_buf = g_string_new(NULL);
+ gutil_log_func = test_log_fn;
module.level = GLOG_LEVEL_INHERIT;
gutil_log_default.level = GLOG_LEVEL_ERR;
@@ -77,10 +79,10 @@
gutil_log(NULL, GLOG_LEVEL_DEBUG, "Debug!");
gutil_log(&module, GLOG_LEVEL_DEBUG, "Debug!");
gutil_log_assert(NULL, GLOG_LEVEL_WARN, "Test!", __FILE__, __LINE__);
- g_assert(!test_log_basic_buf->len);
+ g_assert(!test_log_buf->len);
gutil_log(&module, GLOG_LEVEL_ERR, "Err!");
- g_assert(test_log_basic_buf->len);
- g_string_set_size(test_log_basic_buf, 0);
+ g_assert(test_log_buf->len);
+ g_string_set_size(test_log_buf, 0);
/* With NULL parent, still gutil_log_default is going to be checked */
module.parent = NULL;
@@ -88,19 +90,19 @@
gutil_log(NULL, GLOG_LEVEL_DEBUG, "Debug!");
gutil_log(&module, GLOG_LEVEL_DEBUG, "Debug!");
gutil_log_assert(NULL, GLOG_LEVEL_WARN, "Test!", __FILE__, __LINE__);
- g_assert(!test_log_basic_buf->len);
+ g_assert(!test_log_buf->len);
gutil_log(&module, GLOG_LEVEL_ERR, "Err!");
- g_assert(test_log_basic_buf->len);
- g_string_set_size(test_log_basic_buf, 0);
+ g_assert(test_log_buf->len);
+ g_string_set_size(test_log_buf, 0);
gutil_log(&module, GLOG_LEVEL_ALWAYS, "Always!");
- g_assert(test_log_basic_buf->len);
- g_string_set_size(test_log_basic_buf, 0);
+ g_assert(test_log_buf->len);
+ g_string_set_size(test_log_buf, 0);
/* Test GLOG_FLAG_DISABLE */
module.flags |= GLOG_FLAG_DISABLE;
gutil_log(&module, GLOG_LEVEL_ALWAYS, "Always!");
- g_assert(!test_log_basic_buf->len);
+ g_assert(!test_log_buf->len);
module.flags &= ~GLOG_FLAG_DISABLE;
/* Without log functions these calls have no effect */
@@ -109,8 +111,8 @@
gutil_log_func2 = NULL;
gutil_log(NULL, GLOG_LEVEL_ALWAYS, "Always!");
- g_string_free(test_log_basic_buf, TRUE);
- test_log_basic_buf = NULL;
+ g_string_free(test_log_buf, TRUE);
+ test_log_buf = NULL;
gutil_log_default.level = level;
gutil_log_func = fn;
gutil_log_func2 = fn2;
@@ -135,6 +137,16 @@
static
void
+test_log_drop(
+ const GLogModule* module,
+ int level,
+ const char* format,
+ va_list va)
+{
+}
+
+static
+void
test_log_file(
void)
{
@@ -145,6 +157,7 @@
FILE* out = fopencookie(buf, "w", funcs);
FILE* default_stdout = stdout;
const int level = gutil_log_default.level;
+ GLogProc2 log_proc;
g_assert(out);
g_assert(gutil_log_set_type(GLOG_TYPE_STDOUT, NULL));
@@ -158,7 +171,7 @@
stdout = default_stdout;
g_assert(fflush(out) == 0);
GDEBUG("%s", buf->str);
- g_assert(!g_strcmp0(buf->str, "WARNING: Test\n"));
+ g_assert_cmpstr(buf->str, == ,"WARNING: Test\n");
g_string_set_size(buf, 0);
/* Error prefix */
@@ -167,7 +180,7 @@
stdout = default_stdout;
g_assert(fflush(out) == 0);
GDEBUG("%s", buf->str);
- g_assert(!g_strcmp0(buf->str, "ERROR: Test\n"));
+ g_assert_cmpstr(buf->str, == ,"ERROR: Test\n");
g_string_set_size(buf, 0);
/* Empty name (dropped) */
@@ -177,7 +190,7 @@
stdout = default_stdout;
g_assert(fflush(out) == 0);
GDEBUG("%s", buf->str);
- g_assert(!g_strcmp0(buf->str, "Test\n"));
+ g_assert_cmpstr(buf->str, == ,"Test\n");
g_string_set_size(buf, 0);
/* Non-empty name */
@@ -187,7 +200,7 @@
stdout = default_stdout;
g_assert(fflush(out) == 0);
GDEBUG("%s", buf->str);
- g_assert(!g_strcmp0(buf->str, "[test] Test\n"));
+ g_assert_cmpstr(buf->str, == ,"[test] Test\n");
g_string_set_size(buf, 0);
/* Hide the name */
@@ -197,9 +210,16 @@
stdout = default_stdout;
g_assert(fflush(out) == 0);
GDEBUG("%s", buf->str);
- g_assert(!g_strcmp0(buf->str, "Test\n"));
+ g_assert_cmpstr(buf->str, == ,"Test\n");
g_string_set_size(buf, 0);
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/test/test_misc/test_misc.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2019 Jolla Ltd.
- * Copyright (C) 2016-2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2022 Jolla Ltd.
+ * Copyright (C) 2016-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -173,20 +173,158 @@
g_assert(!gutil_parse_int("", 0, NULL));
g_assert(!gutil_parse_int("garbage", 0, NULL));
g_assert(!gutil_parse_int("0 trailing garbage", 0, NULL));
+ g_assert(!gutil_parse_int("0", -1, NULL));
+ g_assert(!gutil_parse_int("0", 1, NULL));
g_assert(gutil_parse_int("0", 0, NULL));
g_assert(gutil_parse_int("0", 0, &value));
- g_assert(value == 0);
+ g_assert_cmpint(value, == ,0);
+ g_assert(gutil_parse_int("-1", 0, &value));
+ g_assert_cmpint(value, == ,-1);
+ g_assert(gutil_parse_int("42", 0, &value));
+ g_assert_cmpint(value, == ,42);
g_assert(!gutil_parse_int("0x10000000000000000", 0, &value));
g_assert(!gutil_parse_int("-2147483649", 0, &value));
g_assert(!gutil_parse_int("4294967295", 0, &value));
g_assert(gutil_parse_int(" 0x7fffffff ", 0, &value));
- g_assert(value == 0x7fffffff);
+ g_assert_cmpint(value, == ,0x7fffffff);
g_assert(gutil_parse_int(" 7fffffff ", 16, &value));
- g_assert(value == 0x7fffffff);
+ g_assert_cmpint(value, == ,0x7fffffff);
+ g_assert(gutil_parse_int("7ffffffe ", 16, &value));
+ g_assert_cmpint(value, == ,0x7ffffffe);
g_assert(!gutil_parse_int("0xffffffff", 0, &value));
}
/*==========================================================================*
+ * parse_uint
+ *==========================================================================*/
+
+static
+void
+test_parse_uint(
+ void)
+{
+ unsigned int value;
+
+ g_assert(!gutil_parse_uint(NULL, 0, NULL));
+ g_assert(!gutil_parse_uint("", 0, NULL));
+ g_assert(!gutil_parse_uint("garbage", 0, NULL));
+ g_assert(!gutil_parse_uint("0 trailing garbage", 0, NULL));
+ g_assert(!gutil_parse_uint("0", -1, NULL));
+ g_assert(!gutil_parse_uint("0", 1, NULL));
+ g_assert(gutil_parse_uint("0", 0, NULL));
+ g_assert(gutil_parse_uint("0", 0, &value));
+ g_assert_cmpuint(value, == ,0);
+ g_assert(gutil_parse_uint("42", 0, &value));
+ g_assert_cmpuint(value, == ,42);
+ g_assert(!gutil_parse_uint("0x10000000000000000", 0, &value));
+#if defined __SIZEOF_INT__ && __SIZEOF_INT__ == 4
+ g_assert(!gutil_parse_uint("0x100000000", 0, &value));
+#endif
+ g_assert(!gutil_parse_uint("-2147483649", 0, &value));
+ g_assert(!gutil_parse_uint("-1", 0, &value));
+ g_assert(!gutil_parse_uint(" -1 ", 0, &value));
+ g_assert(gutil_parse_uint("4294967295", 0, &value));
+ g_assert_cmpuint(value, == ,4294967295U);
+ g_assert(gutil_parse_uint(" 0x7fffffff ", 0, &value));
+ g_assert_cmpuint(value, == ,0x7fffffff);
+ g_assert(gutil_parse_uint(" 7fffffff ", 16, &value));
+ g_assert_cmpuint(value, == ,0x7fffffff);
+ g_assert(gutil_parse_uint("7ffffffe ", 16, &value));
+ g_assert_cmpuint(value, == ,0x7ffffffe);
+ g_assert(gutil_parse_uint("0xffffffff", 0, &value));
+ g_assert_cmpuint(value, == ,0xffffffff);
+}
+
+/*==========================================================================*
+ * parse_int64
+ *==========================================================================*/
+
+static
+void
+test_parse_int64(
+ void)
+{
+ gint64 value;
+
+ g_assert(!gutil_parse_int64(NULL, 0, NULL));
+ g_assert(!gutil_parse_int64("", 0, NULL));
+ g_assert(!gutil_parse_int64("garbage", 0, NULL));
+ g_assert(!gutil_parse_int64("0 trailing garbage", 0, NULL));
+ g_assert(!gutil_parse_int64("0", -1, NULL));
+ g_assert(!gutil_parse_int64("0", 1, NULL));
+ g_assert(gutil_parse_int64("0", 0, NULL));
+ g_assert(gutil_parse_int64("0", 0, &value));
+ g_assert_cmpint(value, == ,0);
+ g_assert(gutil_parse_int64("-1", 0, &value));
+ g_assert_cmpint(value, == ,-1);
+ g_assert(gutil_parse_int64("42", 0, &value));
+ g_assert_cmpint(value, == ,42);
+ g_assert(gutil_parse_int64("-2147483649", 0, &value));
+ g_assert_cmpint(value, == ,G_GINT64_CONSTANT(-2147483649));
+ g_assert(gutil_parse_int64("4294967295", 0, &value));
+ g_assert_cmpint(value, == ,G_GINT64_CONSTANT(4294967295));
+ g_assert(gutil_parse_int64(" 0x7fffffff ", 0, &value));
+ g_assert_cmpint(value, == ,0x7fffffff);
+ g_assert(gutil_parse_int64(" 7fffffff ", 16, &value));
+ g_assert_cmpint(value, == ,0x7fffffff);
+ g_assert(gutil_parse_int64("7ffffffe ", 16, &value));
+ g_assert_cmpint(value, == ,0x7ffffffe);
+ g_assert(gutil_parse_int64("0xffffffff", 0, &value));
+ g_assert_cmpint(value, == ,0xffffffff);
+ g_assert(gutil_parse_int64("-9223372036854775808", 0, &value));
+ g_assert_cmpint(value, == ,0x8000000000000000);
+ g_assert(gutil_parse_int64("9223372036854775807", 0, &value));
+ g_assert_cmpint(value, == ,0x7fffffffffffffff);
+#ifndef _WIN32
+ g_assert(!gutil_parse_int64("0x10000000000000000", 0, &value));
+ g_assert(!gutil_parse_int64("-9223372036854775809", 0, &value));
+ g_assert(!gutil_parse_int64("9223372036854775808", 0, &value));
+#endif
+}
+
+/*==========================================================================*
+ * parse_uint64
+ *==========================================================================*/
+
+static
+void
+test_parse_uint64(
+ void)
+{
+ guint64 value;
+
+ g_assert(!gutil_parse_uint64(NULL, 0, NULL));
+ g_assert(!gutil_parse_uint64("", 0, NULL));
+ g_assert(!gutil_parse_uint64("garbage", 0, NULL));
+ g_assert(!gutil_parse_uint64("0 trailing garbage", 0, NULL));
+ g_assert(!gutil_parse_uint64("0", -1, NULL));
+ g_assert(!gutil_parse_uint64("0", 1, NULL));
+ g_assert(gutil_parse_uint64("0", 0, NULL));
+ g_assert(gutil_parse_uint64("0", 0, &value));
+ g_assert_cmpuint(value, == ,0);
+ g_assert(gutil_parse_uint64("42", 0, &value));
+ g_assert_cmpuint(value, == ,42);
+ g_assert(!gutil_parse_uint64("-2147483649", 0, &value));
+ g_assert(!gutil_parse_uint64("-1", 0, &value));
+ g_assert(!gutil_parse_uint64(" -1 ", 0, &value));
+ g_assert(gutil_parse_uint64("4294967295", 0, &value));
+ g_assert_cmpuint(value, == ,4294967295U);
+ g_assert(!gutil_parse_uint64(" 0x7fffffff ffffffff ", 0, &value));
+ g_assert(gutil_parse_uint64(" 0x7fffffffffffffff ", 0, &value));
+ g_assert_cmpuint(value, == ,0x7fffffffffffffff);
+ g_assert(!gutil_parse_uint64(" 7fffffff ffffffff", 16, &value));
+ g_assert(gutil_parse_uint64(" 7fffffffffffffff ", 16, &value));
+ g_assert_cmpuint(value, == ,0x7fffffffffffffff);
+ g_assert(gutil_parse_uint64("0x100000000", 0, &value));
+ g_assert_cmpuint(value, == ,0x100000000);
+ g_assert(gutil_parse_uint64("0xffffffffffffffff", 0, &value));
+ g_assert_cmpuint(value, == ,0xffffffffffffffff);
+#ifndef _WIN32
+ g_assert(!gutil_parse_uint64("0x10000000000000000", 0, &value));
+#endif
+}
+
+/*==========================================================================*
* data_equal
*==========================================================================*/
@@ -485,6 +623,216 @@
}
/*==========================================================================*
+ * ptrv_length
+ *==========================================================================*/
+
+static
+void
+test_ptrv_length(
+ void)
+{
+ static const gconstpointer ptrv0[] = { NULL };
+ static const gconstpointer ptrv1[] = { ptrv0, NULL };
+
+ g_assert_cmpuint(gutil_ptrv_length(NULL), == ,0);
+ g_assert_cmpuint(gutil_ptrv_length(ptrv0), == ,0);
+ g_assert_cmpuint(gutil_ptrv_length(ptrv1), == ,1);
+}
+
+/*==========================================================================*
+ * ptrv_free
+ *==========================================================================*/
+
+static
+void
+test_ptrv_free(
+ void)
+{
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/logger/src/libglibutil/test/test_strv/test_strv.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2015-2019 Jolla Ltd.
- * Copyright (C) 2015-2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2015-2022 Jolla Ltd.
+ * Copyright (C) 2015-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -84,6 +84,35 @@
}
/*==========================================================================*
+ * Add
+ *==========================================================================*/
+
+static
+void
+test_addv(
+ void)
+{
+ char** sv1;
+ char** sv2;
+
+ g_assert(!gutil_strv_add(NULL, NULL));
+ g_assert(!gutil_strv_addv(NULL, NULL, NULL));
+
+ sv1 = gutil_strv_add(NULL, "a");
+ g_assert(gutil_strv_addv(sv1, NULL, NULL) == sv1);
+ sv2 = gutil_strv_addv(NULL, "a", NULL);
+ g_assert(gutil_strv_equal(sv1, sv2));
+
+ g_strfreev(sv1);
+ sv1 = g_strsplit("a,bb,ccc", ",", 0);
+ sv2 = gutil_strv_addv(sv2, "bb", "ccc", NULL);
+ g_assert(gutil_strv_equal(sv1, sv2));
+
+ g_strfreev(sv1);
+ g_strfreev(sv2);
+}
+
+/*==========================================================================*
* Equal
*==========================================================================*/
@@ -92,15 +121,14 @@
test_equal(
void)
{
- /* gutil_strv_add(NULL, NULL) is a nop */
- char** sv1 = gutil_strv_add(gutil_strv_add(gutil_strv_add(gutil_strv_add(
- gutil_strv_add(gutil_strv_add(NULL, NULL), "a"), "b"), "c"), " "), "");
+ char** sv1 = gutil_strv_addv(NULL, "a", "b", "c", " ", "", NULL);
char** sv2 = g_strsplit("a,b,c, ,", ",", 0);
char** sv3 = g_strsplit("a,a,a, ,", ",", 0);
char** sv4 = g_strsplit("a,b,c,,", ",", 0);
char** sv5 = g_strsplit("a,b,c,", ",", 0);
char* empty = NULL;
+ g_assert(!gutil_strv_add(NULL, NULL));
g_assert(gutil_strv_equal(NULL, NULL));
g_assert(gutil_strv_equal(NULL, &empty));
g_assert(gutil_strv_equal(&empty, NULL));
@@ -135,7 +163,12 @@
g_assert(gutil_strv_contains(sv, "b"));
g_assert(gutil_strv_contains(sv, "c"));
g_assert(!gutil_strv_contains(sv, "d"));
- g_assert(gutil_strv_find(sv, "b") == 1);
+ g_assert_cmpint(gutil_strv_find(sv, "b"), == ,1);
+ g_assert_cmpint(gutil_strv_find_last(sv, "a"), == ,0);
+ g_assert_cmpint(gutil_strv_find_last(sv, "b"), == ,2);
+ g_assert_cmpint(gutil_strv_find_last(sv, "c"), == ,3);
+ g_assert_cmpint(gutil_strv_find_last(sv, "d"), == ,-1);
+ g_assert_cmpint(gutil_strv_find_last(NULL, NULL), == ,-1);
g_assert(!gutil_strv_contains(sv, NULL));
g_assert(!gutil_strv_contains(NULL, "a"));
g_assert(!gutil_strv_contains(NULL, NULL));
@@ -151,6 +184,37 @@
test_remove(
void)
{
+ guint orig_len = 8;
+ char** sv = g_strsplit("a,b,c,b,c,c,d,b", ",", 0); /* 8 elements */
+ char** sv1 = g_strsplit("a,b,b,c,c,d,b", ",", 0); /* Minus one c */
+ char** sv2 = g_strsplit("a,c,c,d", ",", 0); /* Minus all b's */
+ char** sv3 = g_strsplit("a,c,c", ",", 0); /* Minus all (actually one) d */
+
+ g_assert(!gutil_strv_remove_all(NULL, NULL));
+ g_assert(gutil_strv_remove_all(sv, NULL) == sv);
+ g_assert_cmpuint(gutil_strv_length(sv), == ,orig_len);
+
+ g_assert(sv == gutil_strv_remove_all(sv, "e")); /* "e" is not there */
+ g_assert_cmpuint(gutil_strv_length(sv), == ,orig_len);
+ g_assert(gutil_strv_equal(sv = gutil_strv_remove_one(sv, "c"), sv1));
+ g_assert(gutil_strv_equal(sv = gutil_strv_remove_all(sv, "b"), sv2));
+ g_assert(gutil_strv_equal(sv = gutil_strv_remove_all(sv, "d"), sv3));
+
+ g_strfreev(sv);
+ g_strfreev(sv1);
+ g_strfreev(sv2);
+ g_strfreev(sv3);
+}
+
+/*==========================================================================*
+ * RemoveAt
+ *==========================================================================*/
+
+static
+void
+test_remove_at(
+ void)
+{
char** sv = g_strsplit("a,b,c", ",", 0);
char* c = sv[2];
@@ -170,6 +234,27 @@
}
/*==========================================================================*
+ * RemoveDups
+ *==========================================================================*/
+
+static
+void
+test_remove_dups(
+ void)
+{
+ char** sv = g_strsplit("a,b,c,b,c,c,d,b", ",", 0); /* 8 elements */
+ char** sv1 = g_strsplit("a,b,c,d", ",", 0); /* No dups */
+
+ g_assert(!gutil_strv_remove_dups(NULL));
+ g_assert(gutil_strv_equal(sv = gutil_strv_remove_dups(sv), sv1));
+ g_assert(sv == gutil_strv_remove_dups(sv)); /* Nothing to realloc */
+ g_assert(gutil_strv_equal(sv, sv1)); /* Still equal */
+
+ g_strfreev(sv);
+ g_strfreev(sv1);
+}
+
+/*==========================================================================*
* Sort
*==========================================================================*/
@@ -247,10 +332,13 @@
{
g_test_init(&argc, &argv, NULL);
g_test_add_func(TEST_PREFIX "basic", test_basic);
+ g_test_add_func(TEST_PREFIX "addv", test_addv);
g_test_add_func(TEST_PREFIX "last", test_last);
g_test_add_func(TEST_PREFIX "equal", test_equal);
g_test_add_func(TEST_PREFIX "find", test_find);
g_test_add_func(TEST_PREFIX "remove", test_remove);
+ g_test_add_func(TEST_PREFIX "remove_at", test_remove_at);
+ g_test_add_func(TEST_PREFIX "remove_dups", test_remove_dups);
g_test_add_func(TEST_PREFIX "sort", test_sort);
g_test_add_func(TEST_PREFIX "bsearch", test_bsearch);
g_test_add_func(TEST_PREFIX "strip", test_strip);
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/nfc/nfc.pro
^
|
@@ -1,24 +1,27 @@
openrepos {
- PREFIX = openrepos
+ PREFIX = openrepos-logger
DEFINES += OPENREPOS
} else {
- PREFIX = harbour
+ PREFIX = harbour-logger
}
-NAME = logger-nfc
+NAME = nfc
TARGET = $${PREFIX}-$${NAME}
app_settings {
# This path is hardcoded in jolla-settings
TRANSLATIONS_PATH = /usr/share/translations
+ DEFINES += APP_TRANSLATIONS_PATH=$${TRANSLATIONS_PATH}
} else {
TRANSLATIONS_PATH = /usr/share/$${TARGET}/translations
+ # Let the app figure it out at run time
}
CONFIG += sailfishapp link_pkgconfig
PKGCONFIG += sailfishapp mlite5 gio-2.0 gio-unix-2.0 glib-2.0
QT += dbus
+DEFINES += APP_PREFIX=$${PREFIX}
WARNINGS = -Wall -Wno-unused-parameter -Wno-deprecated-declarations
EXTRA_CFLAGS = $$WARNINGS -fvisibility=hidden
QMAKE_CXXFLAGS += $$EXTRA_CFLAGS
@@ -32,7 +35,7 @@
EXTRA_RELEASE_CFLAGS = -fPIC -flto -ffat-lto-objects
QMAKE_CXXFLAGS += $$EXTRA_RELEASE_CFLAGS
QMAKE_CFLAGS += $$EXTRA_RELEASE_CFLAGS
- QMAKE_LFLAGS += -fPIC -flto
+ QMAKE_LFLAGS += -fpie -flto
}
# Directories
@@ -43,19 +46,19 @@
LOGGER_LIB = $$OUT_PWD/../logger/liblogger.a
PRE_TARGETDEPS += \
- $$LOGGER_LIB \
- $$HARBOUR_LIB
+ $$LOGGER_LIB \
+ $$HARBOUR_LIB
LIBS += \
- $$LOGGER_LIB \
- $$HARBOUR_LIB
+ $$LOGGER_LIB \
+ $$HARBOUR_LIB
OTHER_FILES += \
- icons/harbour-$${NAME}.svg \
- *.desktop \
- qml/*.qml \
- privileges/* \
- translations/*.ts
+ icons/harbour-$${NAME}.svg \
+ *.desktop \
+ qml/*.qml \
+ privileges/* \
+ translations/*.ts
TARGET_DATA_DIR = /usr/share/$${TARGET}
TARGET_ICON_ROOT = /usr/share/icons/hicolor
@@ -65,12 +68,26 @@
INSTALLS += logger_qml
INCLUDEPATH += \
- src \
- $${LOGGER_LIB_DIR}/include \
- $${HARBOUR_LIB_DIR}/include
+ src \
+ $${LOGGER_LIB_DIR}/include \
+ $${HARBOUR_LIB_DIR}/include
SOURCES += \
- src/main.cpp
+ src/main.cpp
+
+# libglibutil
+
+LIBGLIBUTIL = $${LOGGER_LIB_DIR}/src/libglibutil
+LIBGLIBUTIL_SRC = $${LIBGLIBUTIL}/src
+
+INCLUDEPATH += \
+ $${LIBGLIBUTIL}/include
+
+SOURCES += \
+ $${LIBGLIBUTIL_SRC}/gutil_log.c \
+ $${LIBGLIBUTIL_SRC}/gutil_misc.c \
+ $${LIBGLIBUTIL_SRC}/gutil_ring.c \
+ $${LIBGLIBUTIL_SRC}/gutil_strv.c
# harbour-lib QML components
@@ -96,7 +113,7 @@
}
# Priveleges
-privileges.files = privileges/$${PREFIX}-logger-nfc
+privileges.files = privileges/$${PREFIX}-nfc
privileges.path = /usr/share/mapplauncherd/privileges.d/
INSTALLS += privileges
@@ -110,7 +127,7 @@
$${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\"
+ cp \"$${_PRO_FILE_PWD_}/$${icon_dir}/harbour-logger-$${NAME}.png\" \"$${OUT_PWD}/$${icon_dir}/$${TARGET}.png\"
} else {
$${icon_target}.files = $${icon_dir}/$${TARGET}.png
}
@@ -120,19 +137,19 @@
# Translations
TRANSLATION_IDBASED=-idbased
TRANSLATION_SOURCES = \
- $${_PRO_FILE_PWD_}/src \
- $${_PRO_FILE_PWD_}/qml \
- $${LOGGER_LIB_DIR}/qml \
- $${LOGGER_LIB_DIR}/settings
+ $${_PRO_FILE_PWD_}/src \
+ $${_PRO_FILE_PWD_}/qml \
+ $${LOGGER_LIB_DIR}/qml \
+ $${LOGGER_LIB_DIR}/settings
TRANSLATION_FILES = \
- $${NAME} \
- $${NAME}-pl \
- $${NAME}-ru
+ $${NAME} \
+ $${NAME}-pl \
+ $${NAME}-ru
for(t, TRANSLATION_FILES) {
suffix = $$replace(t,-,_)
- in = $${_PRO_FILE_PWD_}/translations/harbour-$${t}
+ in = $${_PRO_FILE_PWD_}/translations/harbour-logger-$${t}
out = $${OUT_PWD}/translations/$${PREFIX}-$${t}
lupdate_target = lupdate_$$suffix
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/nfc/src/main.cpp
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2019-2021 Jolla Ltd.
- * Copyright (C) 2019-2021 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2019-2022 Jolla Ltd.
+ * Copyright (C) 2019-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -32,10 +32,26 @@
#include "LoggerMain.h"
+#include <sailfishapp.h>
+
#include <QQuickView>
#define SUPER LoggerMain
+#ifdef APP_TRANSLATIONS_PATH
+# define APP_TRANS_DIR QT_STRINGIFY(APP_TRANSLATIONS_PATH)
+# pragma message("Translations dir: " APP_TRANS_DIR)
+#else
+# define APP_TRANS_DIR SailfishApp::pathTo("translations").toLocalFile()
+#endif
+
+#ifdef APP_PREFIX
+# define APP_NAME_PREFIX QT_STRINGIFY(APP_PREFIX)
+# pragma message("App prefix: " APP_NAME_PREFIX)
+#else
+# define APP_NAME_PREFIX "harbour-logger"
+#endif
+
class NfcLogger: public SUPER
{
Q_OBJECT
@@ -48,8 +64,8 @@
};
NfcLogger::NfcLogger(int* aArgc, char** aArgv, QStringList aPackages) :
- SUPER(aArgc, aArgv, "org.sailfishos.nfc.daemon", aPackages, "nfc",
- "qml/main.qml")
+ SUPER(aArgc, aArgv, "org.sailfishos.nfc.daemon", aPackages,
+ APP_NAME_PREFIX, "nfc", "qml/main.qml", APP_TRANS_DIR)
{
}
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/nfc/translations/harbour-logger-nfc-pl.ts
^
|
@@ -31,7 +31,7 @@
<message id="logger-logpage-msg-unprivileged">
<source>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one. Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!</source>
<extracomment>Log entry</extracomment>
- <translation type="unfinished">Ta aplikacja powinna działać w trybie uprzywilejowanym, ale wydaje się, że tak nie jest. Najprawdopodobniej problem tkwi w piaskownicy, chociaż mogą być inne przyczyny.
+ <translation>Ta aplikacja powinna działać w trybie uprzywilejowanym, ale wydaje się, że tak nie jest. Najprawdopodobniej problem tkwi w piaskownicy, chociaż mogą być inne przyczyny.
W każdym razie aplikacja najprawdopodobniej nie będzie działać w tej formie :(
</translation>
@@ -43,7 +43,7 @@
</message>
<message id="logger-logpage-msg-connect-error">
<source>We are having trouble connecting to the service.</source>
- <translation>Problem z połączeniem się z usługą.</translation>
+ <translation>Mamy problemy z połączenie z usługami.</translation>
</message>
<message id="logger-logpage-msg-disconnected">
<source>Connection lost.</source>
@@ -56,7 +56,7 @@
<message id="logger-logpage-hint-jump_to_bottom">
<source>Jump to the end of the log to see the most recent messages and follow new messages in real time</source>
<extracomment>Hint text, displayed on long tap</extracomment>
- <translation>Przejdź do ostatniej wiadomości i śledź nowe wiadomości w czasie rzeczywistym</translation>
+ <translation>Przejdź do ostatniej wiadomości i śledź nowe w czasie rzeczywistym</translation>
</message>
<message id="logger-categories-title">
<source>Log categories</source>
@@ -64,15 +64,15 @@
</message>
<message id="logger-categories-pm-enable-all">
<source>Enable all</source>
- <translation>Włącz wszystkie</translation>
+ <translation>Włącz wszystko</translation>
</message>
<message id="logger-categories-pm-disable-all">
<source>Disable all</source>
- <translation>Wyłącz wszystkie</translation>
+ <translation>Wyłącz wszystko</translation>
</message>
<message id="logger-categories-pm-default">
<source>Reset to default</source>
- <translation>Wróć do domyślnych ustawień</translation>
+ <translation>Przywróć do wartości fabrycznych</translation>
</message>
<message id="logger-categories-select-placeholder">
<source>Select categories</source>
@@ -89,7 +89,7 @@
</message>
<message id="logger-sharepage-save-ok">
<source>Saved %1</source>
- <translation>Zapisano</translation>
+ <translation>Zapisano %1</translation>
</message>
<message id="logger-sharepage-save-error">
<source>Failed to save %1</source>
@@ -115,7 +115,7 @@
</message>
<message id="logger-sharepage-warning">
<source>Keep in mind that some of the information contained in this archive may be considered private. If you would like to check what you are about to send, please consider sending it to yourself and checking its contents first.</source>
- <translation>Pamiętaj, że niektóre informacje zawarte w tym archiwum można uznać za prywatne. Jeśli chcesz sprawdzić, co zamierzasz wysłać, rozważ przesłanie go do siebie i sprawdzenie jego zawartości.</translation>
+ <translation>Miej na uwadze, że część informacji zawartych w tym archiwum może być prywatna. Jeśli chcesz sprawdzić co wysyłasz, proszę rozważ wysłanie logów, w pierwszej kolejności, do siebie i sprawdzź ich zawartość. </translation>
</message>
<message id="logger-sharepage-please-wait">
<source>Please wait</source>
@@ -124,7 +124,7 @@
<message id="logger-sharepage-broken">
<source>In-app sharing is not available in this version of Sailfish OS. Use the pulley menu to save tarball to the documents folder.</source>
<extracomment>Info label displayed instead of sharing method list</extracomment>
- <translation>Niestety w tej wersji Sailfish OS udostępnianie nie działa. Użyj menu wysuwanego, aby zapisać plik tar w katalogu dokumenty.</translation>
+ <translation>Udostęnianie nie jest dostępne w tej wersji Sailfish OS. Użyj pulley menu, aby zapisać plik tar w dokumentach.</translation>
</message>
<message id="openrepos-logger-nfc-app_name">
<source>NFC Logger</source>
@@ -139,19 +139,19 @@
<message id="logger-settings-section-header-display">
<source>Display</source>
<extracomment>Section header</extracomment>
- <translation>Wyświetlanie</translation>
+ <translation>Wyświetl</translation>
</message>
<message id="logger-settings-logsizelimit">
<source>Screen buffer size</source>
- <translation>Rozmiar buforu ekranu</translation>
+ <translation>Rozmiar bufora ekranu</translation>
</message>
<message id="logger-settings-logsizelimit-description">
<source>Don't worry, everything will be written to the log file regardless of the screen buffer size.</source>
- <translation>Nie martw się, wszystko zostanie zapisane w pliku dziennika bez względu na rozmiar bufora ekranu.</translation>
+ <translation>Nie martw się, wszystko zostanie zapisane do pliku logów, bez względu na rozmiar buforu ekranu.</translation>
</message>
<message id="logger-settings-logsizelimit-unlimited">
<source>Unlimited</source>
- <translation>Nielimitowany</translation>
+ <translation>Nieograniczone</translation>
</message>
<message id="logger-settings-fontsize-label">
<source>Font size</source>
@@ -170,17 +170,17 @@
<message id="logger-settings-autoenable_logging-switch-description">
<source>Enable all logging categories when the application starts.</source>
<extracomment>Text switch description</extracomment>
- <translation>Włącz wszytskie kategorie logowania podczas uruchamiania aplikacji.</translation>
+ <translation>Włącz wszystkie kategorie logowania podczas startu aplikacji.</translation>
</message>
<message id="logger-settings-autoreset_logging-switch-label">
<source>Automatically reset logging on exit</source>
<extracomment>Text switch label</extracomment>
- <translation>Automatycznie reseuj logowanie podczas wyjścia z aplikacji</translation>
+ <translation>Automatycznie zresetuj logi na wyjściu</translation>
</message>
<message id="logger-settings-autoreset_logging-switch-description">
<source>Reset all logging categories to their default values when the application is exiting. Otherwise logging would continue in the background, wasting the system resources and eating up your battery.</source>
<extracomment>Text switch description</extracomment>
- <translation>Zresetuj wszystkie kategorie logowania do ich wartości domyślnych podczas zamykania aplikacji. W przeciwnym razie rejestrowanie będzie kontynuowane w tle, marnując zasoby systemowe i zużywając baterię.</translation>
+ <translation>Zresetuj wszystkie kategorie logowania do wartości domyślnych podczas opuszczania aplikacji. W innym przypadku logowanie będzie kontynuowane w tle, zużywając zasoby i rozładowując baterię.</translation>
</message>
</context>
</TS>
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/ofono/ofono.pro
^
|
@@ -1,18 +1,26 @@
+sailfish-log-viewer {
+ PREFIX = sailfish-log-viewer
+ DEFINES += OPENREPOS SAILFISH_LOG_VIEWER
+}
openrepos {
- PREFIX = openrepos
+ PREFIX = openrepos-logger
DEFINES += OPENREPOS
-} else {
- PREFIX = harbour
+}
+!sailfish-log-viewer:!openrepos {
+ CONFIG += harbour
+ PREFIX = harbour-logger
}
-NAME = logger-ofono
+NAME = ofono
TARGET = $${PREFIX}-$${NAME}
app_settings {
# This path is hardcoded in jolla-settings
TRANSLATIONS_PATH = /usr/share/translations
+ DEFINES += APP_TRANSLATIONS_PATH=$${TRANSLATIONS_PATH}
} else {
TRANSLATIONS_PATH = /usr/share/$${TARGET}/translations
+ # Let the app figure it out at run time
}
CONFIG += sailfishapp link_pkgconfig
@@ -21,7 +29,7 @@
WARNINGS = -Wall -Wno-unused-parameter -Wno-deprecated-declarations
EXTRA_CFLAGS = $$WARNINGS -fvisibility=hidden
-DEFINES += QOFONOEXT_EXPORT=Q_DECL_HIDDEN
+DEFINES += APP_PREFIX=$${PREFIX}
QMAKE_CXXFLAGS += $$EXTRA_CFLAGS
QMAKE_CFLAGS += $$EXTRA_CFLAGS
@@ -33,32 +41,31 @@
EXTRA_RELEASE_CFLAGS = -fPIC -flto -ffat-lto-objects
QMAKE_CXXFLAGS += $$EXTRA_RELEASE_CFLAGS
QMAKE_CFLAGS += $$EXTRA_RELEASE_CFLAGS
- QMAKE_LFLAGS += -fPIC -flto
+ QMAKE_LFLAGS += -fpie -flto
}
# Directories
HARBOUR_LIB_DIR = $$_PRO_FILE_PWD_/../harbour-lib
LOGGER_LIB_DIR = $$_PRO_FILE_PWD_/../logger
-QOFONOEXT_LIB_DIR = $$_PRO_FILE_PWD_/src/libqofonoext
QCONNMAN_LIB_DIR = $$_PRO_FILE_PWD_/../libconnman-qt
# Libraries
LOGGER_LIB = $$OUT_PWD/../logger/liblogger.a
PRE_TARGETDEPS += \
- $$LOGGER_LIB \
- $$HARBOUR_LIB
+ $$LOGGER_LIB \
+ $$HARBOUR_LIB
LIBS += \
- $$LOGGER_LIB \
- $$HARBOUR_LIB
+ $$LOGGER_LIB \
+ $$HARBOUR_LIB
OTHER_FILES += \
- icons/harbour-$${NAME}.svg \
- *.desktop \
- qml/*.qml \
- privileges/* \
- translations/*.ts
+ icons/harbour-logger-$${NAME}.svg \
+ *.desktop \
+ qml/*.qml \
+ privileges/* \
+ translations/*.ts
TARGET_DATA_DIR = /usr/share/$${TARGET}
TARGET_ICON_ROOT = /usr/share/icons/hicolor
@@ -68,21 +75,44 @@
INSTALLS += logger_qml
INCLUDEPATH += \
- src \
- $${LOGGER_LIB_DIR}/include \
- $${HARBOUR_LIB_DIR}/include \
- $${QOFONOEXT_LIB_DIR}/src \
- $${QCONNMAN_LIB_DIR}/libconnman-qt
+ src \
+ $${LOGGER_LIB_DIR}/include \
+ $${HARBOUR_LIB_DIR}/include \
+ $${QCONNMAN_LIB_DIR}/libconnman-qt
HEADERS += \
- $${QOFONOEXT_LIB_DIR}/src/qofonoextmodemmanager.h \
- $${QCONNMAN_LIB_DIR}/libconnman-qt/networktechnology.h
+ $${QCONNMAN_LIB_DIR}/libconnman-qt/networktechnology.h
SOURCES += \
- src/main.cpp \
- $${QOFONOEXT_LIB_DIR}/src/qofonoext.cpp \
- $${QOFONOEXT_LIB_DIR}/src/qofonoextmodemmanager.cpp \
- $${QCONNMAN_LIB_DIR}/libconnman-qt/networktechnology.cpp
+ src/main.cpp \
+ $${QCONNMAN_LIB_DIR}/libconnman-qt/networktechnology.cpp
+
+# sailfish-log-viewer can link with libqofonoext and libglibutil
+
+sailfish-log-viewer {
+ PKGCONFIG += qofonoext libglibutil
+} else {
+ DEFINES += QOFONOEXT_EXPORT=Q_DECL_HIDDEN
+
+ QOFONOEXT_LIB_DIR = $$_PRO_FILE_PWD_/src/libqofonoext
+ LIBGLIBUTIL = $${LOGGER_LIB_DIR}/src/libglibutil
+ LIBGLIBUTIL_SRC = $${LIBGLIBUTIL}/src
+
+ INCLUDEPATH += \
+ $${QOFONOEXT_LIB_DIR}/src \
+ $${LIBGLIBUTIL}/include
+
+ HEADERS += \
+ $${QOFONOEXT_LIB_DIR}/src/qofonoextmodemmanager.h \
+
+ SOURCES += \
+ $${QOFONOEXT_LIB_DIR}/src/qofonoext.cpp \
+ $${QOFONOEXT_LIB_DIR}/src/qofonoextmodemmanager.cpp \
+ $${LIBGLIBUTIL_SRC}/gutil_log.c \
+ $${LIBGLIBUTIL_SRC}/gutil_misc.c \
+ $${LIBGLIBUTIL_SRC}/gutil_ring.c \
+ $${LIBGLIBUTIL_SRC}/gutil_strv.c
+}
# harbour-lib QML components
@@ -115,7 +145,7 @@
}
# Priveleges
-privileges.files = privileges/$${PREFIX}-logger-ofono
+privileges.files = privileges/$${PREFIX}-ofono
privileges.path = /usr/share/mapplauncherd/privileges.d/
INSTALLS += privileges
@@ -125,11 +155,11 @@
icon_target = icon$${s}
icon_dir = icons/$${s}x$${s}
$${icon_target}.path = /usr/share/icons/hicolor/$${s}x$${s}/apps
- openrepos {
+ !harbour {
$${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\"
+ cp \"$${_PRO_FILE_PWD_}/$${icon_dir}/harbour-logger-$${NAME}.png\" \"$${OUT_PWD}/$${icon_dir}/$${TARGET}.png\"
} else {
$${icon_target}.files = $${icon_dir}/$${TARGET}.png
}
@@ -139,22 +169,23 @@
# Translations
TRANSLATION_IDBASED=-idbased
TRANSLATION_SOURCES = \
- $${_PRO_FILE_PWD_}/src \
- $${_PRO_FILE_PWD_}/qml \
- $${LOGGER_LIB_DIR}/qml \
- $${LOGGER_LIB_DIR}/settings
+ $${_PRO_FILE_PWD_}/src \
+ $${_PRO_FILE_PWD_}/qml \
+ $${LOGGER_LIB_DIR}/qml \
+ $${LOGGER_LIB_DIR}/settings
TRANSLATION_FILES = \
- $${NAME} \
- $${NAME}-nl \
- $${NAME}-pl \
- $${NAME}-ru \
- $${NAME}-sv \
- $${NAME}-zh_CN
+ $${NAME} \
+ $${NAME}-fr \
+ $${NAME}-nl \
+ $${NAME}-pl \
+ $${NAME}-ru \
+ $${NAME}-sv \
+ $${NAME}-zh_CN
for(t, TRANSLATION_FILES) {
suffix = $$replace(t,-,_)
- in = $${_PRO_FILE_PWD_}/translations/harbour-$${t}
+ in = $${_PRO_FILE_PWD_}/translations/harbour-logger-$${t}
out = $${OUT_PWD}/translations/$${PREFIX}-$${t}
lupdate_target = lupdate_$$suffix
|
[-]
[+]
|
Added |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/ofono/privileges/sailfish-log-viewer-ofono
^
|
@@ -0,0 +1,2 @@
+# Tells invoker to run ofono logger as nemo:privileged
+/usr/bin/sailfish-log-viewer-ofono,
|
[-]
[+]
|
Added |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/ofono/sailfish-log-viewer-ofono.desktop
^
|
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Type=Application
+Name=Ofono Log
+X-Nemo-Application-Type=silica-qt5
+Icon=sailfish-log-viewer-ofono
+Exec=sailfish-log-viewer-ofono
+
+[X-HarbourBackup]
+BackupConfigList=/apps/sailfish-log-viewer-ofono/
+
+[X-Sailjail]
+Sandboxing=Disabled
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/ofono/src/main.cpp
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2021 Jolla Ltd.
- * Copyright (C) 2016-2021 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2022 Jolla Ltd.
+ * Copyright (C) 2016-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -36,6 +36,8 @@
#include "qofonoextmodemmanager.h"
#include "networktechnology.h"
+#include <sailfishapp.h>
+
#include <QQuickView>
#include <QQmlContext>
@@ -46,6 +48,20 @@
#define SUPER LoggerMain
+#ifdef APP_TRANSLATIONS_PATH
+# define APP_TRANS_DIR QT_STRINGIFY(APP_TRANSLATIONS_PATH)
+# pragma message("Translations dir: " APP_TRANS_DIR)
+#else
+# define APP_TRANS_DIR SailfishApp::pathTo("translations").toLocalFile()
+#endif
+
+#ifdef APP_PREFIX
+# define APP_NAME_PREFIX QT_STRINGIFY(APP_PREFIX)
+# pragma message("App prefix: " APP_NAME_PREFIX)
+#else
+# define APP_NAME_PREFIX "harbour-logger"
+#endif
+
class OfonoLogger: public SUPER
{
Q_OBJECT
@@ -94,7 +110,8 @@
const QString OfonoLogger::AUTO("auto");
OfonoLogger::OfonoLogger(int* aArgc, char** aArgv, QStringList aPackages) :
- SUPER(aArgc, aArgv, "org.ofono", aPackages, "ofono", "qml/main.qml"),
+ SUPER(aArgc, aArgv, "org.ofono", aPackages, APP_NAME_PREFIX, "ofono",
+ "qml/main.qml", APP_TRANS_DIR),
iModemManager(QOfonoExtModemManager::instance()),
iNetworkTechnology(new NetworkTechnology(this)),
iFilesSaved(false),
|
[-]
[+]
|
Added |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/ofono/translations/harbour-logger-ofono-fr.ts
^
|
@@ -0,0 +1,194 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="fr">
+<context>
+ <name></name>
+ <message id="logger-cover-title">
+ <source>Log</source>
+ <translation>ofono</translation>
+ </message>
+ <message id="logger-mainpage-swipe-left-hint">
+ <source>Swipe left to configure log categories</source>
+ <translation>Balayer vers la gauche pour configurer les catégories de log</translation>
+ </message>
+ <message id="logger-notification-copied_to_clipboard">
+ <source>Copied to clipboard</source>
+ <extracomment>Pop-up notification</extracomment>
+ <translation>Copié dans le presse-papier</translation>
+ </message>
+ <message id="ofono-logger-pm-fix-mobile-data">
+ <source>Fix mobile data</source>
+ <extracomment>Pull-down menu item</extracomment>
+ <translation>Réparer données mobiles</translation>
+ </message>
+ <message id="ofono-logger-pm-enable-mobile-data">
+ <source>Enable mobile data</source>
+ <extracomment>Pull-down menu item</extracomment>
+ <translation>Activer les données mobiles</translation>
+ </message>
+ <message id="logger-logpage-pm-clear-log">
+ <source>Clear log</source>
+ <translation>Effacer le log</translation>
+ </message>
+ <message id="logger-logpage-pm-pack-and-send">
+ <source>Pack and send</source>
+ <translation>Compresser et envoyer</translation>
+ </message>
+ <message id="logger-logpage-title">
+ <source>Log</source>
+ <translation>Ofono log</translation>
+ </message>
+ <message id="logger-logpage-msg-unprivileged">
+ <source>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one. Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!</source>
+ <extracomment>Log entry</extracomment>
+ <translation>Cette application doit être lancée en mode 'privileged' mais apparemment ce n'est pas le cas. Le confinement en bac à sable est la raison la plus probable de cela, mais pas la seule. Quelle que soit la raison, les logs ne seront pas disponibles. Désolé pour le dérangement !
+</translation>
+ </message>
+ <message id="logger-logpage-msg-connected">
+ <source>Connected.</source>
+ <extracomment>Log entry</extracomment>
+ <translation>Connecté à ofono.</translation>
+ </message>
+ <message id="logger-logpage-msg-connect-error">
+ <source>We are having trouble connecting to the service.</source>
+ <translation>Nous avons des problèmes pour nous connecter à ofono. Il se peut que cette version ne supporte pas le log.</translation>
+ </message>
+ <message id="logger-logpage-msg-disconnected">
+ <source>Connection lost.</source>
+ <translation>Perte de connexion à ofono.</translation>
+ </message>
+ <message id="logger-logpage-msg-log-cleared">
+ <source>Log cleared</source>
+ <translation>Log effacé</translation>
+ </message>
+ <message id="logger-logpage-hint-jump_to_bottom">
+ <source>Jump to the end of the log to see the most recent messages and follow new messages in real time</source>
+ <extracomment>Hint text, displayed on long tap</extracomment>
+ <translation>Aller à la fin du log pour voir les messages les plus récents et suivre les nouveaux messages en temps réel</translation>
+ </message>
+ <message id="logger-categories-title">
+ <source>Log categories</source>
+ <translation>Catégories de log</translation>
+ </message>
+ <message id="logger-categories-pm-enable-all">
+ <source>Enable all</source>
+ <translation>Tout activer</translation>
+ </message>
+ <message id="logger-categories-pm-disable-all">
+ <source>Disable all</source>
+ <translation>Tout désactiver</translation>
+ </message>
+ <message id="logger-categories-pm-default">
+ <source>Reset to default</source>
+ <translation>Réinitialiser</translation>
+ </message>
+ <message id="logger-categories-select-placeholder">
+ <source>Select categories</source>
+ <extracomment>Placeholder text for the search field</extracomment>
+ <translation>Choisir les catégories</translation>
+ </message>
+ <message id="logger-categories-not-connected">
+ <source>Not connected</source>
+ <translation>Non connecté à ofono</translation>
+ </message>
+ <message id="logger-sharemethodlist-add-account">
+ <source>Add account</source>
+ <translation>Ajouter un compte</translation>
+ </message>
+ <message id="logger-sharepage-save-ok">
+ <source>Saved %1</source>
+ <translation>Sauvegarder %1</translation>
+ </message>
+ <message id="logger-sharepage-save-error">
+ <source>Failed to save %1</source>
+ <translation>Échec de la sauvegarde %1</translation>
+ </message>
+ <message id="logger-sharepage-pm-save-to-documents">
+ <source>Save to documents</source>
+ <translation>Sauvegarder dans documents</translation>
+ </message>
+ <message id="logger-sharepage-header">
+ <source>Pack and send</source>
+ <translation>Compresser et envoyer</translation>
+ </message>
+ <message id="logger-sharepage-default-subject">
+ <source>Log</source>
+ <extracomment>Default email subject</extracomment>
+ <translation>ofono log</translation>
+ </message>
+ <message id="logger-sharepage-default-email">
+ <source></source>
+ <extracomment>Default email recipient</extracomment>
+ <translation>ofono-debug@jolla.com</translation>
+ </message>
+ <message id="logger-sharepage-warning">
+ <source>Keep in mind that some of the information contained in this archive may be considered private. If you would like to check what you are about to send, please consider sending it to yourself and checking its contents first.</source>
+ <translation>Ayez à l'esprit que des informations contenues dans cette archive peuvent être considérées comme privées. Si vous désirez vérifier ce que vous êtes sur le point d'envoyer, svp pensez à l'envoyer à vous-même et vérifiez le contenu d'abord.</translation>
+ </message>
+ <message id="logger-sharepage-please-wait">
+ <source>Please wait</source>
+ <translation>Veuillez patienter</translation>
+ </message>
+ <message id="logger-sharepage-broken">
+ <source>In-app sharing is not available in this version of Sailfish OS. Use the pulley menu to save tarball to the documents folder.</source>
+ <extracomment>Info label displayed instead of sharing method list</extracomment>
+ <translation>Le partage via l'application n'est pas disponible dans cette version de Salifish OS. Uitlisez le menu déroulant pour sauvegarder le fichier 'tar' dans le dossier 'documents'.</translation>
+ </message>
+ <message id="openrepos-logger-ofono-app_name">
+ <source>Ofono Log</source>
+ <extracomment>Settings page title (app name)</extracomment>
+ <translation>Ofono Log</translation>
+ </message>
+ <message id="logger-settings-page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Version %1</translation>
+ </message>
+ <message id="logger-settings-section-header-display">
+ <source>Display</source>
+ <extracomment>Section header</extracomment>
+ <translation>Affichage</translation>
+ </message>
+ <message id="logger-settings-logsizelimit">
+ <source>Screen buffer size</source>
+ <translation>Taille du buffer d'écran</translation>
+ </message>
+ <message id="logger-settings-logsizelimit-description">
+ <source>Don't worry, everything will be written to the log file regardless of the screen buffer size.</source>
+ <translation>Pas de souci, tout sera écrit dans le fichier de log indépendamment de la taill du buffer d'écran.</translation>
+ </message>
+ <message id="logger-settings-logsizelimit-unlimited">
+ <source>Unlimited</source>
+ <translation>Illimitée</translation>
+ </message>
+ <message id="logger-settings-fontsize-label">
+ <source>Font size</source>
+ <translation>Taille de police</translation>
+ </message>
+ <message id="logger-settings-section-header-logging">
+ <source>Logging</source>
+ <extracomment>Section header</extracomment>
+ <translation>Log en cours</translation>
+ </message>
+ <message id="logger-settings-autoenable_logging-switch-label">
+ <source>Automatically enable logging</source>
+ <extracomment>Text switch label</extracomment>
+ <translation>Activer le log automatique</translation>
+ </message>
+ <message id="logger-settings-autoenable_logging-switch-description">
+ <source>Enable all logging categories when the application starts.</source>
+ <extracomment>Text switch description</extracomment>
+ <translation>Activer toutes les catégories au démarrage.</translation>
+ </message>
+ <message id="logger-settings-autoreset_logging-switch-label">
+ <source>Automatically reset logging on exit</source>
+ <extracomment>Text switch label</extracomment>
+ <translation>Réinitialisation automatique du log à la sortie</translation>
+ </message>
+ <message id="logger-settings-autoreset_logging-switch-description">
+ <source>Reset all logging categories to their default values when the application is exiting. Otherwise logging would continue in the background, wasting the system resources and eating up your battery.</source>
+ <extracomment>Text switch description</extracomment>
+ <translation>Réinitialisation de toutes les catégories de log quand l'application se termine. Sinon, le log reste activé en arrière plan, utilisant des ressources système et de la batterie.</translation>
+ </message>
+</context>
+</TS>
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-ofono-1.0.22.tar.bz2/ofono/translations/harbour-logger-ofono-pl.ts
^
|
@@ -41,7 +41,7 @@
<message id="logger-logpage-msg-unprivileged">
<source>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one. Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!</source>
<extracomment>Log entry</extracomment>
- <translation type="unfinished">Ta aplikacja powinna działać w trybie uprzywilejowanym, ale wydaje się, że tak nie jest. Najprawdopodobniej problem tkwi w piaskownicy, chociaż mogą być inne przyczyny.
+ <translation>Ta aplikacja powinna działać w trybie uprzywilejowanym, ale wydaje się, że tak nie jest. Najprawdopodobniej problem tkwi w piaskownicy, chociaż mogą być inne przyczyny.
W każdym razie aplikacja najprawdopodobniej nie będzie działać w tej formie :(
</translation>
@@ -66,7 +66,7 @@
<message id="logger-logpage-hint-jump_to_bottom">
<source>Jump to the end of the log to see the most recent messages and follow new messages in real time</source>
<extracomment>Hint text, displayed on long tap</extracomment>
- <translation type="unfinished">Przejdź do ostatniej wiadomości i śledź nowe w czasie rzeczywistym</translation>
+ <translation>Przejdź do ostatniej wiadomości i śledź nowe w czasie rzeczywistym</translation>
</message>
<message id="logger-categories-title">
<source>Log categories</source>
@@ -134,7 +134,7 @@
<message id="logger-sharepage-broken">
<source>In-app sharing is not available in this version of Sailfish OS. Use the pulley menu to save tarball to the documents folder.</source>
<extracomment>Info label displayed instead of sharing method list</extracomment>
- <translation type="unfinished">Niestety w tej wersji Sailfish OS nic tak łatwego do udostępnienia nie zadziała. Możesz zapisać plik tar w dokumentach, a następnie sam wymyślić, co z nim zrobić.</translation>
+ <translation>Udostęnianie nie jest dostępne w tej wersji Sailfish OS. Użyj pulley menu, aby zapisać plik tar w dokumentach.</translation>
</message>
<message id="openrepos-logger-ofono-app_name">
<source>Ofono Log</source>
|