Commit 01bf76e9 authored by Jenkins's avatar Jenkins

Updated version 0.94 from 'upstream/0.94'

with Debian dir fd9ce291b8ebf21c4ea67d5616d82316cea6b7a0
parents eb836939 9d0910b4
build
run
libqofono.pro.user*
*~
*.a
*.la
*.core
*.moc
*.o
*.obj
*.orig
*.swp
*.rej
*.so
*.pbxuser
*.mode1
*.mode1v3
*_pch.h.cpp
*_resource.rc
.#*
*.*#
core
.qmake.cache
.qmake.vars
config.log
*.prl
tags
.DS_Store
*.debug
Makefile*
*.app
*.pro.user
*.qmlproject.user
*.gcov
moc_*.cpp
ui_*.h
qrc_*.cpp
This diff is collapsed.
qofono
======
A library for accessing the ofono daemon, and a declarative plugin for it. This allows accessing ofono in qtquick and friends.
- audio settings API
- cdma* API
- dundee API
- simtoolkit API
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS += src \
plugin \
test
equals(QT_MAJOR_VERSION, 4):{
SUBDIRS += ofonotest
}
equals(QT_MAJOR_VERSION, 4): {
OTHER_FILES += rpm/libqofono.spec \
rpm/libqofono.yaml
}
equals(QT_MAJOR_VERSION, 5): {
OTHER_FILES += rpm/libqofono-qt5.spec \
rpm/libqofono-qt5.yaml \
TODO \
README
}
#!/bin/bash
# Determine project name based on current directory
#PROJECT=$(basename $PWD)
PROJECT=libqofono
# NOTE: Don't like this? Then uncomment one of the following as appropriate
#
# Just set it explictly to whatever you like:
# PROJECT=libseaside
#
# Parse it from any Qt *.pro or *.pri files in CWD:
# PROJECT=$(grep -E "TARGET ?= ?" *.pr[io]|cut -d' ' -f3)
while getopts qht: o
do case $o in
h) head=1;;
t) TAG="$OPTARG";;
q) PROJECT=libqofono-qt5;;
?) printf >&2 "Usage: $0 [-h] [-t TAG]\n"
exit 2;;
esac
done
# Grab most recent tag from git unless TAG is set
if [ -z "$TAG" ] ; then
TAG=$(git describe --tags --abbrev=0)
fi
# Parse out just the version number
#PARTS=(${TAG//-/ })
#VERSION=${PARTS[1]}
VERSION=${TAG}
# Set name of toplevel directory for the archive
PREFIX="${PROJECT}-${VERSION}/"
# Set name of resulting release archive file
ARCHIVE=${PROJECT}-${VERSION}.tar.bz2
[ -e ${ARCHIVE} ] && rm -rf ${ARCHIVE} && echo "Removed: ${ARCHIVE}"
if [ ! -z "$head" ] ; then
TAG="HEAD"
fi
git archive --format=tar --prefix=${PREFIX} $TAG | bzip2 -c -- > ${ARCHIVE} && {
echo "Created: ${ARCHIVE}"
} || {
echo "Creation of release archive ${ARCHIVE} failed. Reason unknown."
}
#include <QApplication>
#include "qmlapplicationviewer.h"
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QScopedPointer<QApplication> app(createApplication(argc, argv));
QmlApplicationViewer viewer;
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
viewer.setMainQmlFile(QLatin1String("qml/ofonotest/main.qml"));
viewer.showExpanded();
return app->exec();
}
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Name=ofonotest
Exec=/opt/ofonotest/bin/ofonotest
Icon=ofonotest64
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
# Add more folders to ship with the application, here
folder_01.source = qml/ofonotest
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01
# Additional import path used to resolve QML modules in Creator's code model
QML_IMPORT_PATH =
# If your application uses the Qt Mobility libraries, uncomment the following
# lines and add the respective components to the MOBILITY variable.
# CONFIG += mobility
# MOBILITY +=
# Speed up launching on MeeGo/Harmattan when using applauncherd daemon
CONFIG += qdeclarative-boostable
# The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp
# Please do not modify the following two lines. Required for deployment.
include(qmlapplicationviewer/qmlapplicationviewer.pri)
qtcAddDeployment()
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Name=ofonotest
Exec=/usr/bin/invoker --type=d -s /opt/ofonotest/bin/ofonotest
Icon=/usr/share/icons/hicolor/80x80/apps/ofonotest80.png
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
import QtQuick 1.1
import MeeGo.QOfono 0.2
Rectangle {
width: 480
height: 560
Text {
id: textLine
anchors.centerIn: parent
}
Text {
id: textLine2
anchors.top: textLine.bottom
text: manager.available ? netreg.name : "Ofono not available"
}
MouseArea {
anchors.fill: parent
onClicked: {
context1.active = !context1.active
}
}
OfonoManager {
id: manager
onAvailableChanged: {
console.log("Ofono is " + available)
textLine2.text = manager.available ? netreg.currentOperator["Name"].toString() :"Ofono not available"
}
onModemAdded: {
console.log("modem added "+modem)
}
onModemRemoved: console.log("modem removed")
}
OfonoConnMan {
id: ofono1
Component.onCompleted: {
// console.log(manager.modems)
}
modemPath: manager.modems[0]
}
OfonoModem {
id: modem1
modemPath: manager.modems[0]
}
OfonoContextConnection {
id: context1
contextPath : ofono1.contexts[0]
Component.onCompleted: {
textLine.text = context1.active ? "online" : "offline"
}
onActiveChanged: {
textLine.text = context1.active ? "online" : "offline"
}
}
OfonoNetworkRegistration {
modemPath: manager.modems[0]
id: netreg
Component.onCompleted: {
netreg.scan()
}
onNetworkOperatorsChanged : {
console.log("operators :"+netreg.currentOperator["Name"].toString())
}
}
OfonoNetworkOperator {
id: netop
}
}
// checksum 0xbe90 version 0x90018
/*
This file was generated by the Qt Quick Application wizard of Qt Creator.
QmlApplicationViewer is a convenience class containing mobile device specific
code such as screen orientation handling. Also QML paths and debugging are
handled here.
It is recommended not to modify this file, since newer versions of Qt Creator
may offer an updated version of it.
*/
#include "qmlapplicationviewer.h"
#include <QDir>
#include <QFileInfo>
#include <QApplication>
#include <QDeclarativeComponent>
#include <QDeclarativeEngine>
#include <QDeclarativeContext>
#include <qplatformdefs.h> // MEEGO_EDITION_HARMATTAN
#ifdef HARMATTAN_BOOSTER
#include <MDeclarativeCache>
#endif
#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
#include <qt_private/qdeclarativedebughelper_p.h>
#if !defined(NO_JSDEBUGGER)
#include <jsdebuggeragent.h>
#endif
#if !defined(NO_QMLOBSERVER)
#include <qdeclarativeviewobserver.h>
#endif
// Enable debugging before any QDeclarativeEngine is created
struct QmlJsDebuggingEnabler
{
QmlJsDebuggingEnabler()
{
QDeclarativeDebugHelper::enableDebugging();
}
};
// Execute code in constructor before first QDeclarativeEngine is instantiated
static QmlJsDebuggingEnabler enableDebuggingHelper;
#endif // QMLJSDEBUGGER
class QmlApplicationViewerPrivate
{
QString mainQmlFile;
friend class QmlApplicationViewer;
static QString adjustPath(const QString &path);
};
QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
{
#ifdef Q_OS_MAC
if (!QDir::isAbsolutePath(path))
return QString::fromLatin1("%1/../Resources/%2")
.arg(QCoreApplication::applicationDirPath(), path);
#elif defined(Q_OS_BLACKBERRY)
if (!QDir::isAbsolutePath(path))
return QString::fromLatin1("app/native/%1").arg(path);
#elif !defined(Q_OS_ANDROID)
QString pathInInstallDir =
QString::fromLatin1("%1/../%2").arg(QCoreApplication::applicationDirPath(), path);
if (QFileInfo(pathInInstallDir).exists())
return pathInInstallDir;
pathInInstallDir =
QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), path);
if (QFileInfo(pathInInstallDir).exists())
return pathInInstallDir;
#endif
return path;
}
QmlApplicationViewer::QmlApplicationViewer(QWidget *parent)
: QDeclarativeView(parent)
, d(new QmlApplicationViewerPrivate())
{
connect(engine(), SIGNAL(quit()), SLOT(close()));
setResizeMode(QDeclarativeView::SizeRootObjectToView);
// Qt versions prior to 4.8.0 don't have QML/JS debugging services built in
#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
#if !defined(NO_JSDEBUGGER)
new QmlJSDebugger::JSDebuggerAgent(engine());
#endif
#if !defined(NO_QMLOBSERVER)
new QmlJSDebugger::QDeclarativeViewObserver(this, this);
#endif
#endif
}
QmlApplicationViewer::~QmlApplicationViewer()
{
delete d;
}
QmlApplicationViewer *QmlApplicationViewer::create()
{
return new QmlApplicationViewer();
}
void QmlApplicationViewer::setMainQmlFile(const QString &file)
{
d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
#ifdef Q_OS_ANDROID
setSource(QUrl(QLatin1String("assets:/")+d->mainQmlFile));
#else
setSource(QUrl::fromLocalFile(d->mainQmlFile));
#endif
}
void QmlApplicationViewer::addImportPath(const QString &path)
{
engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
}
void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
{
#if QT_VERSION < 0x050000
Qt::WidgetAttribute attribute;
switch (orientation) {
#if QT_VERSION < 0x040702
// Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
case ScreenOrientationLockPortrait:
attribute = static_cast<Qt::WidgetAttribute>(128);
break;
case ScreenOrientationLockLandscape:
attribute = static_cast<Qt::WidgetAttribute>(129);
break;
default:
case ScreenOrientationAuto:
attribute = static_cast<Qt::WidgetAttribute>(130);
break;
#else // QT_VERSION < 0x040702
case ScreenOrientationLockPortrait:
attribute = Qt::WA_LockPortraitOrientation;
break;
case ScreenOrientationLockLandscape:
attribute = Qt::WA_LockLandscapeOrientation;
break;
default:
case ScreenOrientationAuto:
attribute = Qt::WA_AutoOrientation;
break;
#endif // QT_VERSION < 0x040702
};
setAttribute(attribute, true);
#else // QT_VERSION < 0x050000
Q_UNUSED(orientation)
#endif // QT_VERSION < 0x050000
}
void QmlApplicationViewer::showExpanded()
{
#if defined(MEEGO_EDITION_HARMATTAN) || defined(Q_WS_SIMULATOR) || defined(Q_OS_QNX)
showFullScreen();
#elif defined(Q_WS_MAEMO_5)
showMaximized();
#else
show();
#endif
}
QApplication *createApplication(int &argc, char **argv)
{
#ifdef HARMATTAN_BOOSTER
return MDeclarativeCache::qApplication(argc, argv);
#else
return new QApplication(argc, argv);
#endif
}
// checksum 0xc67a version 0x90018
/*
This file was generated by the Qt Quick Application wizard of Qt Creator.
QmlApplicationViewer is a convenience class containing mobile device specific
code such as screen orientation handling. Also QML paths and debugging are
handled here.
It is recommended not to modify this file, since newer versions of Qt Creator
may offer an updated version of it.
*/
#ifndef QMLAPPLICATIONVIEWER_H
#define QMLAPPLICATIONVIEWER_H
#include <QDeclarativeView>
class QmlApplicationViewer : public QDeclarativeView
{
Q_OBJECT
public:
enum ScreenOrientation {
ScreenOrientationLockPortrait,
ScreenOrientationLockLandscape,
ScreenOrientationAuto
};
explicit QmlApplicationViewer(QWidget *parent = 0);
virtual ~QmlApplicationViewer();
static QmlApplicationViewer *create();
void setMainQmlFile(const QString &file);
void addImportPath(const QString &path);
// Note that this will only have an effect on Fremantle.
void setOrientation(ScreenOrientation orientation);
void showExpanded();
private:
class QmlApplicationViewerPrivate *d;
};
QApplication *createApplication(int &argc, char **argv);
#endif // QMLAPPLICATIONVIEWER_H
# checksum 0xf003 version 0x90018
# This file was generated by the Qt Quick Application wizard of Qt Creator.
# The code below adds the QmlApplicationViewer to the project and handles the
# activation of QML debugging.
# It is recommended not to modify this file, since newer versions of Qt Creator
# may offer an updated version of it.
QT += declarative
SOURCES += $$PWD/qmlapplicationviewer.cpp
HEADERS += $$PWD/qmlapplicationviewer.h
INCLUDEPATH += $$PWD
# Include JS debugger library if QMLJSDEBUGGER_PATH is set
!isEmpty(QMLJSDEBUGGER_PATH) {
include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
} else {
DEFINES -= QMLJSDEBUGGER
}
contains(CONFIG,qdeclarative-boostable):contains(MEEGO_EDITION,harmattan) {
DEFINES += HARMATTAN_BOOSTER
}
# This file was generated by an application wizard of Qt Creator.
# The code below handles deployment to Android and Maemo, aswell as copying
# of the application data to shadow build directories on desktop.
# It is recommended not to modify this file, since newer versions of Qt Creator
# may offer an updated version of it.
defineTest(qtcAddDeployment) {
for(deploymentfolder, DEPLOYMENTFOLDERS) {
item = item$${deploymentfolder}
greaterThan(QT_MAJOR_VERSION, 4) {
itemsources = $${item}.files
} else {
itemsources = $${item}.sources
}
$$itemsources = $$eval($${deploymentfolder}.source)
itempath = $${item}.path
$$itempath= $$eval($${deploymentfolder}.target)
export($$itemsources)
export($$itempath)
DEPLOYMENT += $$item
}
MAINPROFILEPWD = $$PWD
android-no-sdk {
for(deploymentfolder, DEPLOYMENTFOLDERS) {
item = item$${deploymentfolder}
itemfiles = $${item}.files
$$itemfiles = $$eval($${deploymentfolder}.source)
itempath = $${item}.path
$$itempath = /data/user/qt/$$eval($${deploymentfolder}.target)
export($$itemfiles)
export($$itempath)
INSTALLS += $$item
}
target.path = /data/user/qt
export(target.path)
INSTALLS += target
} else:android {
for(deploymentfolder, DEPLOYMENTFOLDERS) {
item = item$${deploymentfolder}
itemfiles = $${item}.files
$$itemfiles = $$eval($${deploymentfolder}.source)
itempath = $${item}.path
$$itempath = /assets/$$eval($${deploymentfolder}.target)
export($$itemfiles)
export($$itempath)
INSTALLS += $$item
}
x86 {
target.path = /libs/x86
} else: armeabi-v7a {
target.path = /libs/armeabi-v7a
} else {
target.path = /libs/armeabi
}
export(target.path)
INSTALLS += target
} else:win32 {
copyCommand =
for(deploymentfolder, DEPLOYMENTFOLDERS) {
source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
source = $$replace(source, /, \\)
sourcePathSegments = $$split(source, \\)
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments)
target = $$replace(target, /, \\)
target ~= s,\\\\\\.?\\\\,\\,
!isEqual(source,$$target) {
!isEmpty(copyCommand):copyCommand += &&
isEqual(QMAKE_DIR_SEP, \\) {
copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
} else {
source = $$replace(source, \\\\, /)
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
target = $$replace(target, \\\\, /)
copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
}
}
}
!isEmpty(copyCommand) {
copyCommand = @echo Copying application data... && $$copyCommand
copydeploymentfolders.commands = $$copyCommand
first.depends = $(first) copydeploymentfolders
export(first.depends)
export(copydeploymentfolders.commands)
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
}
} else:unix {
maemo5 {
desktopfile.files = $${TARGET}.desktop
desktopfile.path = /usr/share/applications/hildon
icon.files = $${TARGET}64.png
icon.path = /usr/share/icons/hicolor/64x64/apps
} else:!isEmpty(MEEGO_VERSION_MAJOR) {
desktopfile.files = $${TARGET}_harmattan.desktop
desktopfile.path = /usr/share/applications
icon.files = $${TARGET}80.png
icon.path = /usr/share/icons/hicolor/80x80/apps
} else { # Assumed to be a Desktop Unix
copyCommand =
for(deploymentfolder, DEPLOYMENTFOLDERS) {
source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
source = $$replace(source, \\\\, /)
macx {
target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
} else {
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
}
target = $$replace(target, \\\\, /)
sourcePathSegments = $$split(source, /)
targetFullPath = $$target/$$last(sourcePathSegments)
targetFullPath ~= s,/\\.?/,/,
!isEqual(source,$$targetFullPath) {
!isEmpty(copyCommand):copyCommand += &&
copyCommand += $(MKDIR) \"$$target\"
copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\"
}
}
!isEmpty(copyCommand) {
copyCommand = @echo Copying application data... && $$copyCommand
copydeploymentfolders.commands = $$copyCommand
first.depends = $(first) copydeploymentfolders
export(first.depends)
export(copydeploymentfolders.commands)
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
}
}
!isEmpty(target.path) {
installPrefix = $${target.path}
} else {