Skip to content

Instantly share code, notes, and snippets.

Avatar

Kimmo Lindholm kimmoli

View GitHub Profile
@kimmoli
kimmoli / myclass.cpp
Last active Aug 29, 2015
Cover animation disable
View myclass.cpp
#include <QDBusConnection>
...
QDBusConnection::sessionBus().connect("", "/com/jolla/lipstick", "com.jolla.lipstick", "coverstatus",
this, SLOT(handleCoverstatus(const QDBusMessage&)));
...
void myclass::handleCoverstatus(const QDBusMessage& msg)
{
QList<QVariant> args = msg.arguments();
m_coverStatus = args.at(0).toInt();
@kimmoli
kimmoli / myclass.cpp
Last active Aug 29, 2015
QFileSystemWatcher
View myclass.cpp
void Myclass::start()
{
/* Read the file once */
tmpFileProcess("/tmp/testi");
/* Watch the file */
tmpFileNotifier = new QFileSystemWatcher(QStringList() << "/tmp/testi", this);
/* Connect fileChanged to our slot */
connect(tmpFileNotifier, SIGNAL(fileChanged(QString)), this, SLOT(tmpFileProcess(QString)));
View gist:1fb197f91c0c47aa8294
Rectangle
{
color: "transparent"
height: Theme.itemSizeMedium
width: parent.width
Label
{
width: 80
id: bb
View New file.txt
Resistanssi.
Testi.
Kissa.
Resistanssi.
Testi.
Kissa.
@kimmoli
kimmoli / pidditesti.sh
Last active Aug 29, 2015
Pasted from Jolla
View pidditesti.sh
dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames | grep -i coveraction | while read -r line
do
a=`echo $line | cut -d "." -f 4`
b=`echo ${a//pid}`
c=`ps -p $b o ucomm --no-heading`
echo $c
grep -Le "NoDisplay=true" /usr/share/applications/*.desktop | while read file
do
grep -le "Exec.*$c.*" $file
done
View main.qml
import QtQuick 2.0
import Sailfish.Silica 1.0
import "pages"
ApplicationWindow
{
initialPage: Component { Fantsucam { } }
cover: Qt.resolvedUrl("cover/CoverPage.qml")
}
View fmreceiver.qml
/*
Copyright (C) 2013 Jolla Ltd.
Contact: Thomas Perl <thomas.perl@jollamobile.com>
All rights reserved.
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:
* Redistributions of source code must retain the above copyright
View AnotherTest.qml
Page
{
Timer
{
interval: 100
running: true
repeat: true
onTriggered: k.text += "kissa "
}
Label
View Pinchtest.qml
Item
{
Rectangle
{
id: rect
width: 200; height: 200
color: "red"
y: 280
x: 30
onXChanged: console.log(x + " " + y)
@kimmoli
kimmoli / Ekafile.qml
Last active Aug 29, 2015
Edit withgistpud
View Ekafile.qml
TextArea
{
id: area
width: showPastePage.width
height: showPastePage.height - dh.height
anchors.top: dh.bottom
selectionMode: TextEdit.SelectCharacters
readOnly: true