30 Sep 2016

feedPlanet KDE

Tomorrow is a New Day – Joining Blue Systems

I'm very excited to let everyone know that as of tomorrow I'll officially be joining Blue Systems, working full time on KDE and related projects! The chance to really immerse oneself completely into something you love and also work alongside people you absolutely respect is mind-blowing.

I would like to deeply thank Blue Systems for this opportunity, I hope my contributions will match the awesome generosity that everyone in the community has given allowing me do this. Thank you!


30 Sep 2016 10:06pm GMT

In Defence for Permissive Licences; KDE licence policy update

In free software there's a disappointing number of licences which are compatible in some cases and not in others. We have a licence policy in KDE which exists to try to keep consistency of licences to ensure maximum re-usability of our code while still ensuring it remains as free software and companies can't claim additional restrictions which do not exist on code we have generously licenced to them.

Our hero and (occasional chauvinist god character) Richard Stallman invented copyleft and the GNU GPL to ensure people receiving Free code could not claim additional restrictions which do not exist, if they did they lose the right to copy the code under that licence.

An older class of licence is the Permissive Licences, these include the BSD licence, MIT licence and X11 licences, each of which have multiple variants all of which say essentially "do whatever you like but keep this copyright licence included". They aren't maintained so variants are created and interpretations of how they are applied in practice vary without an authority to create consensus. But they're short and easy to apply and many many projects are happy to do so. However there's some curious misconceptions around them. One is that it allows you to claim additional restrictions to the code and require anyone you pass it onto to get a different licence from you. This is nonsense, but it's a myth which is perpetrated by companies who want to abuse other people's generosity in licences and even by groups such as the FSF or SFLC who want to encourage everyone to use the GNU GPL.

Here's the important parts of the MIT licence (modern variant)

Permission is hereby granted...
to deal in the Software without restriction...
subject to the following conditions:
The above copyright notice and this permission notice shall be include

It's very clear that this does not give you licence to remove the licence, anyone who you pass this software on to, as source or binary or other derived form, still needs to have the same licence. You don't need to pass on the source code if it's a binary, in which case it's not free software, but you still need to pass on this licence. It's unclear if the licence is for patents as well as copyright but chances are it is. You can add your own works to it and distribute that under a more restricted licence if you like, but again you still need to pass on this licence for the code you received it as. You can even sublicence it, make a additional licence with more restrictions, but that doesn't mean you can remove the Free licence, it explicitly says you can not. Unlike the GPL there's no penalty for breaking the licence, you can still use the licence if you want and in theory the copyright holder could sue you but in practice it's just a lie and nobody will call you out and many people will even believe your lie.

Techy lawyer Kyle E. Mitchell has written an interesting line by line examination of the MIT licence which it's well worth reading. It's a shame there's no authority to stand up for these licences and most people who use such licences do so because they don't much are about people making claims over their code. But it's important that we realise it doesn't allow any such claims and it remains Free software no matter who's servers it happens to have touched on its way to you.


I'm currently proposing some updates to the KDE licencing policy. I'd like to drop use of the unmaintained FDL in docs and wikis in favour of Creative Commons ShareAlike Attribution 4.0 which is created for international use, well maintained, and would allow sharing text into our code (it's compatible with GPL 3) and from Wikipedia and other wikis (which are CC 3). Plus some other changes like allowing AGPL for web services.

Discussion on kde-community mailing list.

Diff to current.

Facebooktwittergoogle_pluslinkedinby feather

30 Sep 2016 3:00pm GMT

KIO GDrive 1.0 released

I'm happy to finally announce the first stable release of KIO GDrive. KIO GDrive enables KIO-aware applications (such as Dolphin, Kate or Gwenview) to access and edit Google Drive files on the cloud.

Given the lack of an official Google Drive client for Linux, KIO GDrive can be used as replacement for managing your Drive files with Dolphin. Even better, you don't have to use space on your disk! The files are still in the cloud, yet you can edit them as if they were locally stored on your machine.

For example you can edit a text file in Kate or crop an image in Gwenview, and just save those files as you normally would. The edited file will be automatically uploaded on the cloud. This will also work with non-KIO applications, for example Libreoffice, but in this case a dialog will explicity ask if you want to upload the new version of the file.

Dolphin integration is provided by a Desktop file. Just open your menu and look for "Google Drive":

Google Drive Dolphin Integration

The first time you will be asked to provide your Google account (this will hopefully change if we manage to implement single-sign-on via KAccounts):

Google Drive Login

Once you are authenticated, the Desktop entry will just open Dolphin with the gdrive:// URL already set, which shows your accounts and allows you to add new ones.

Google Drive Accounts

When you click an account, you can browse the account files and manage them, as the following screeshot shows.

Google Drive Dolphin

Bugs

This is the first stable release, but bugs might still be out there. If you find a bug, please report it!

Links

30 Sep 2016 9:40am GMT

Mobile IMG 20160930-021219

Weekly mobile IMG update,

Which brings in following

z0crtvp

You can flash using instructions at https://plasma-mobile.org/nexus-5/

30 Sep 2016 6:56am GMT

29 Sep 2016

feedPlanet KDE

Qt Champion nominations for 2016 now open

Qt_Champion_200
It is the time of the year, when we can all take a moment to think who has been the most helpful, incredible, kind, skilled and friendly person in the Qt community.

Qt Champions is a way to recognize the individuals who strive to help the community most. They can be found in different places and doing different things, but they are all united in their drive to make Qt a friendly and helpful community.

Past Qt Champions include among others, Samuel Gaist, who has always been helpful and friendly on the forum, and has more posts than anyone else. Iori Ayane, who has written and translated several books into Japanese, and is a key person in the Japanese Qt scene. Robin Burchell, who is a long time Qt contributor doing excellent work in the code base. And Johan Thelin and Jürgen Bocklage-Ryannel, the authors of the QML book.

In addition to the recognition that the Qt Champion title brings, the champions get a full Qt license for a year, invitations to next years main Qt event and naturally an awesome Qt Champion t-shirt!

So if you have ideas on who should be this years Qt Champion, head over to the Wiki to make your Qt Champion nominations!

The post Qt Champion nominations for 2016 now open appeared first on Qt Blog.

29 Sep 2016 11:49am GMT

MediaWikiToLearn Hackathon + Editathon




FOSS at Amrita presents you for the first time in India, MediaWikiToLearnHack-a-thon and Edit-a-thon in collaboration with Wiki To Learn andWikimedia Foundation at Amrita University, Amritapuri Campus.


Background

FOSSatAmrita, is a student community at Amrita University, Amritapuri Campus. Being one of the most active student communities on the campus, we encourage, support and mentor students to improve their technical and social skills through contributing to open source. We aim at encouraging students to embrace the free and open source approach that is fast gaining momentum. We are a community of students and mentors that support and guide each other towards making open source contributions, and towards the usage of free software. This year, FOSSatAmrita gave 10 selections in Google Summer of Code and 1 in Outreachy, that shows the potential in the students of FOSSatAmrita club.



To ensure more open source contributors, we are bringing this two day hackathon, for the very first time in the history of Amrita University, Amritapuri Campus. MediaWiki is organizing a two-day hackathon to help students understand the working of the MediaWiki and WikiToLearn community. Two days long hackathon would include every aspect - from installing the software, setting up the environment to fixing some easy bugs and submitting the patches for review. (Don't worry if some of the words don't make any sense now, we're here to answer all your queries!)

The program will run from 01st-02nd October with the two parallel tracks:

MediaWiki Hackathon: Run by invited developers and existing MW contributors in the club. Expected participant count of 50, and all requests handled by the below mentioned Google Form. Participants will be given guidance and opportunity to code contribute to the Wikimedia codebase, sending in patch sets, and understanding the code review process. This would make them head start into upcoming Google Summer of Code 2017 and other internship opportunities.

WikiToLearn Edit-a-thon:Teachers and students get together to collaborate and develop open course content on en.wikitolearn.org. Teachers would participate by either editing or reviewing contents in the wiki. This will make it easy for teachers and students to have a structured method to communicate online over academic materials.
Added Benefit

Are you willing to apply for Google Summer of Code (GSoC) but don't know how to start?

Well, that's problem everyone faces at the onset of joining the open source communities.

Attending this workshop would give a clearer picture to anyone who's willing to apply to the open source scholarship programs like Google Summer of Code (GSoC) and/or Outreachy but lacks direction or information. This workshop will leave you with a better understanding of how you may proceed with contributing to an organization of your choice, thus significantly boosting the probability of you getting selected! \o/\o/

Details

Date Saturday and Sunday, October 1 and 2, 2016 Time 10 AM to 8 PMVenue Ground Floor Lab, Amrita University, Amritapuri Campus Contact foss@am.amrita.edu Hashtag #MediaWikiToLearnHack Register Register here. IRC #mediawiki on FreeNode Report Photos Bug fixes and links to patches :
Facilitators
Abdeali JK
Tony Thomas
Abhinand N
Devi Krishnan
Srijan Agarwal
Registration

Fill this Google form to register yourself for the workshop. Since we have limited slots available, we'll keep the event limited to the registered students.

Note on the registration Prerequisites: Please note that you are cloning the development master branch of mediawiki-core form gerrit.wikimedia.org, preferably over SSH. Please follow Gerrit Tutorialtopdown to complete in both the tasks, and in case of any questions, do ask in #wikimedia-dev or #mediawiki or contact the FOSS club at foss@am.amrita.edu
Hackathon Pre-requisite

To make sure all attendees are at the same phase, please ensure that you have the following setup in your machine:
Any working Linux environment, with LAMP server installed. You can find the installation steps for LAMP in Ubuntu here
Any powerful PHP IDE, PHPstorm recommended. You can find the instructions here.
An account in Wikitech, Gerrit, Wikimedia Phabricator, and Github
Try cloning and setting up Gerrit in your machine following the instructions given here
Try connecting with #wikimedia-dev on IRC freenode channel

Important: We are expecting the participants to have a clone of MediaWiki-core downloaded and installed in their machine before hand, so that we can start early with the contribution phase. You can find the detailed instructions on how to setup development environment for Mediawiki in theGerrit/Tutorial

In case you do not have any prior know-how of PHP, Version control or web applications : You are welcome to try setting up a simple registration and login web application in PHP beforehand, in your machine. You can find sample code for the same here. You will have to setup LAMP or similar stack in your machine to test the code locally.

Why Should You Attend?

Reading through the large open-source code base and contributing as code: Increasing their technical and code scripting skills, solving simple to complex real-time problems existing in Mediawiki software.
Motivated students reaching out and getting into internship opportunities like Google Summer of Code and Outreachy: Along with building a strong hold in technical stuff, internship programs like GSoC and Outreachy allow its interns to work on major problems, proposing and implementing their solution under expert mentorships. The selected students get a considerable stipend and its a major addition to the institutional record too.
Active community engagement and other opportunities The workshop would add to the technical know-how of the participants while working closely with a worldwide Wikimedia community, which is the fun part.
FAQs

What you need to know

You need to have some sort of prior experience developing stuff (web apps, mobile apps, data mungers, anything at all!). There are a variety of things you can do (CSS/JS hacks, webapps that use the API, Mobile apps, data mining) that pretty much anyone with some developer experience is bound to find something fun to do. This is a hackathon, and not a workshop.
Knowledge of Free Software License, comfortable using any Online Project hosting websites (like Github) since we would want you make the code you write for the hack freely available, online.
If you feel you might not have anything listed here, think about taking a look at these courses:
Learn PHP online with codecademy
Learn the command line with codecademy
Learn Git online with try.github
Learn bit of Python with learnpython
Go through this repo on Contributing to Open Source and see what you can make out of it.

What language can I use

Any programming language you are comfortable with and can make sense of the MediaWiki code base
Life would get easier if you have some prior programming experience in PHP since most of the MediaWiki code is written in PHP

How can I prepare for the Hackathon
Read through links in Resources, check out the Examples.
Feel free to ask questions! Contact us.

What qualifies me to come
Show us some code you have written, tell us what you know, tell us why you love hacking (and Wikipedia) in general, and you'll get the pass :)
Please sign up here.

How to spread the word
Pass on the word to your fellow geek friends.
Use #MediaWikiToLearnHack on Twitter.

29 Sep 2016 11:37am GMT

Get started with Nextcloud App development in 6 easy steps!

The brand new app scaffolding tool in our app store
Last night, Bernhard Posselt finished the app scaffold tool in the app store, making it easy to get up and running with app development. I was asked on twitter to blog about setting up a development environment, so... here goes.

What's simpler than downloading a zip file, extracting it and running a command in the resulting folder to get an Nextcloud server up on localhost for hacking?

Yes, it can be that simple, though it might require a few minor tweaks and you have to make sure to have all Nextcloud dependencies installed.

Note that this is useful if you want to develop an Nextcloud app. If you want to develop on the Nextcloud core, a git checkout is the way to go and you'll need some extra steps to get the dependencies in place, get started here. Feedback on this process is highly appreciated, especially if it comes with a pull request for our documentation of course ;-)

Step 1 and Two: Dependencies

  • Install PHP and the modules mentioned here
    Your distro should make the installation easy. Try these:
    • openSUSE: zypper in php5 php5-ctype php5-curl php5-dom php5-fileinfo php5-gd php5-iconv php5-json php5-ldap php5-mbstring php5-openssl php5-pdo php5-pear php5-posix php5-sqlite php5-tokenizer php5-xmlreader php5-xmlwriter php5-zip php5-zlib
    • Debian: apt-get install php5 php5-json php5-gd php5-sqlite curl libcurl3 libcurl3-dev php5-curl php5-common php-xml-parser php5-ldap bzip2
  • Make Nextcloud session management work under your own user account.
    Either change the path of php session files or chmod 777 the folder they are in, usually something like /var/lib/php (debian/SUSE) or /var/lib/php/session (Red Hat).

The Final Four Steps


Nextcloud should present you with its installation steps! Give your username and password and you're up and running with SQLite.

Start with the app

Now you create a subfolder in the nextcloud/apps with the name of your app and put in a skeleton. You can generate an app skeleton really easy: use the scaffolding tool, part of our new app store for Nextcloud 11!

It's probably wise to now get going with the app development tutorial here. This isn't updated for the scaffolding tool yet, so you'll have a head start here. Be sure to check out the changelog, we try to make sure the latest changes are noted there so even if we didn't manage to fully update the tutorial, you can find out what will and won't work in the changelog. Also, be sure to update the links to get the latest dev doc - this all links to 11, once that is out it is probably better to directly target 12 and so on.

Help and feedback

Your input is very much welcome! If you run through these steps and get stuck somewhere, let me know and I'll update the documentation. Or, of course better still, do a pull request on the documentation right in github. You don't even have to do a full checkout, smaller fixes can easily be done in the web interface on github.

Last but not least, ask questions on our forums in the app dev channel or on IRC. Here is the Nextloud development IRC chat channel on freenode.net, also accessible via webchat.

Thanks, good luck, and have fun building Nextcloud apps!

29 Sep 2016 10:09am GMT

28 Sep 2016

feedPlanet KDE

Kubuntu beta; please test!

Kubuntu 16.10 beta has been published. It is possible that it will be re-spun, but we have our beta images ready for testing now.

Please go to http://iso.qa.ubuntu.com/qatracker/milestones/367/builds, login, click on the CD icon and download the image. I prefer zsync, which I download via the commandline:

~$ cd /media/valorie/ISOs (or whereever you store your images)
~$ zsync http://cdimage.ubuntu.com/kubuntu/daily-live/20160921/yakkety-desktop-i386.iso.zsync

UPDATE: the beta images have now been published officially. Rather than the daily image above, please download or torrent the beta, or just upgrade. We still need bug reports and your test results on the qatracker, above.

Thanks for your work testing so far!

The other methods of downloading work as well, including wget or just downloading in your browser.

I tested usb-creator-kde which has sometimes now worked, but it worked like a champ once the images were downloaded. Simply choose the proper ISO and device to write to, and create the live image.

Once I figured out how to get my little Dell travel laptop to let me boot from USB (delete key as it is booting; quickly hit f12, legacy boot, then finally I could actually choose to boot from USB). Secure boot and UEFI make this more difficult these days.

I found no problems in the live session, including logging into wireless, so I went ahead and started firefox, logged into http://iso.qa.ubuntu.com/qatracker, chose my test, and reported my results. We need more folks to install on various equipment, including VMs.

When you run into bugs, try to report them via "apport", which means using ubuntu-bug packagename in the commandline. Once apport has logged into launchpad and downloaded the relevant error messages, you can give some details like a short description of the bug, and can get the number. Please report the bug numbers on the qa site in your test report.

Thanks so much for helping us make Kubuntu friendly and high-quality.

28 Sep 2016 9:59pm GMT

Kubuntu 16.10 Beta 2 is here! Test Test Test! And then more Testing

yy-beta2-breezess

October 13 is coming up fast and we need testers for this second Beta. Betas are for regular users who want to help us test by finding issues, reporting them or helping fix them. Installing on hardware or in a VM, it's a great way to help your favorite community-driven Ubuntu based distribution.

Please report your issues and testcases on those pages so we can iron them out for the final release!
For 32 Bit users
For 64 Bit users

Beta 2 download

28 Sep 2016 8:27pm GMT

Dave's QML Binding Loop Backtrace Printer

Binding loops suck, and they can be hard to fix. I wrote a tool that prints a backtrace of the bindings being updated when a loop occurs. See link at bottom.

About:

QML bindings are a very fast and easy way to write a declarative UI. However it's quite easy to accidentally write an infinite loop.
This can happen if we bind propertyA to affect propertyB and also bind propertyB to affect propertyA, they would constantly update each other.

Consider the following example:

1 import QtQuick 2.0
2 
3 Rectangle {
4     width: childrenRect.width
5     Text {
6        text: parent.width > 10 ? "Hello World" : "Hi"
7     }
8 }

The Rectangle width changes on startup, that changes the text's size, which in turn changes the Rectangle's width. If this was undetected the application would loop forever and eventually crash.
QML prints a warning, and ceases processing, but it's an indication that something is wrong with the logic of your code, and it needs fixing.

However, whilst the loop here is obvious to spot, it can be considerably more complicated when looping through tens of bindings over many many components.

Creating a Tool

The problem with this warning is that on its own is rather unhelpful - trying to find the loop then becomes a manual task of tracing all possible combinations through every bindings that could lead to a short circuit. GDB on its own doesn't help as the C++ backtrace tells us absolutely nothing we can use.

I've created a small script that, using gdb, unwinds the backtrace detecting where the properties changed and then showing the QML code which is responsible.

Simply download here into $PATH and run with

"binding-loop-tracker.py myAppName"

In the case of the loop above we will see output like:

=====Binding loop detected - printing backtrace =====
#0 - file:///home/david/temp/binding_loop.qml:4:12
#1 - file:///home/david/temp/binding_loop.qml:6:15
#2 - file:///home/david/temp/binding_loop.qml:4:12

Which shows which line of QML was being updated when we hit the loop.

It still requires some manual work to follow the trace through, but it's a useful aid and has already helped me in two real world cases that I couldn't resolve manually.

28 Sep 2016 1:24pm GMT

KDAB talks at QtCon 2016

Hello!

QtCon_logo

This is a small wrap-up from QtCon, the biggest Qt event in Europe in 2016, that happened at the beginning of September. At QtCon the Qt community joined forces with the KDE, FSFE and VideoLAN communities, to create an exciting event in the spirit of open collaboration and participation amongst projects.

During QtCon many KDAB engineers gave in-depth technical talks about Qt, QML, Qt3D, OpenGL and the other technologies around Qt development. All the sessions were of the highest quality, as you may expect from KDAB speakers, and extremely well received by the audience.

In case you missed some, here's a complete list. You can find each talk's description, slides, code / example material, and a recording of the session by following the links.

In no particular order:

See you at the Qt World Summit!

The post KDAB talks at QtCon 2016 appeared first on KDAB.

28 Sep 2016 12:36pm GMT

Qt on Android: How to create an Android service using Qt

Starting with Qt 5.7, we added the ability to create Android services using Qt. In this article we're going to see how to get started and also how to communicate between the two.

Before we get started I want to add a big bold WARNING about the performance! Because the services are run in the background for a very long time, make sure your service doesn't drain the device battery!

Getting started

Step I: Extend QtService

Every single Qt Android Service must have its own Service java class which extends QtService, so the first step is to create such a service:

// java file goes in android/src/com/kdab/training/MyService.java
package com.kdab.training;
import org.qtproject.qt5.android.bindings.QtService;

public class MyService extends QtService
{
}

Step II: Add the service section(s) to your AndroidManifest.xml file

The next step is to add the service section(s) to your AndroidManifest.xml file. To do that you first need to copy & paste the template from https://wiki.qt.io/AndroidServices to your AndroidManifest.xml file, then set android:name attribute with your service class name, as shown in the following snippet:

<application ... >
  <!-- .... -->
  <service android:process=":qt" android:name=".MyService">
  <!-- android:process=":qt" is needed to force the service to run on a separate
                                                        process than the Activity -->

    <!-- .... -->

    <!-- Background running -->
    <meta-data android:name="android.app.background_running" android:value="true"/>
    <!-- Background running -->
  </service>
  <!-- .... -->
</application>

BE AWARE: Every single Qt service/activity MUST run in it's own process! Therefore for each service you must set a different android:process attribute value.

Step III: How to start the service ?

Now you need to decide how to start the service. There are two ways to do it:

We're going to check them both:

Start the service on demand

This is the most common way to start your service(s). To start the service you just need to call Context.startService(Intent intent) method. The easiest way is to add a static method to your MyService:

// java file goes in android/src/com/kdab/training/MyService.java
package com.kdab.training;

import android.content.Context;
import android.content.Intent;
import org.qtproject.qt5.android.bindings.QtService;

public class MyService extends QtService
{
    public static void startMyService(Context ctx) {
        ctx.startService(new Intent(ctx, MyService.class));
    }
}

Then simply call it from Qt to start it:

QAndroidJniObject::callStaticMethod<void>("com/kdab/training/MyService",
                                              "startMyService",
                                              "(Landroid/content/Context;)V",
                                              QtAndroid::androidActivity().object());

Start the service at boot time

This method is used quite seldom and is useful ONLY when you really need to run the service at boot time, otherwise I do recommend you to start it on demand.

First you need to add android.permission.RECEIVE_BOOT_COMPLETED permission to your AndroidManifest.xml file:

<application ... >

  <!-- .... -->
  <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
</application>

Then you need to add a receiver element to your AndroidManifest.xml file:

<application ... >
    <!-- .... -->
    <receiver android:name=".MyBroadcastReceiver">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
        </intent-filter>
    </receiver>
    <!-- .... -->
</application>

And finally, you need to implement MyBroadcastReceiver class, as shown in the following snippet:

public class MyBroadcastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Intent startServiceIntent = new Intent(context, MyService.class);
        context.startService(startServiceIntent);
    }
}

Step IV: Where to put your Qt Service code?

Next you need to decide where you're going to put your service code. Qt (and qmake) has two options for you:

We're going to check them both:

Same .so for app & service(s)

Because you'll have one big .so file, you need a way to know when it will run as an activity or as a service. To do that you just need pass some arguments to your main function. AndroidManifest.xml allows you to easily do that:

<service ... >
    <!-- ... -->
    <!-- Application arguments -->
    <meta-data android:name="android.app.arguments" android:value="-service"/>
    <!-- Application arguments -->
    <!-- ... -->
</service>

Then make sure you set the same android.app.lib_name metadata for both service(s) & activity elements:

<service ... >
    <!-- ... -->
    <meta-data android:name="android.app.lib_name"
                android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
    <!-- ... -->
</service>

I recommend you to use this method only if your activity and your service(s) share a large piece of code.

Separate .so files for app & service(s)

The second option is to create separate .so files for your app & service(s). First you need to create a separate server .pro file(s):

TEMPLATE = lib
TARGET = server
CONFIG += dll
QT += core
SOURCES += \
    server.cpp

The server .so main entry is the main function:

#include <QDebug>

int main(int argc, char *argv[])
{
    qDebug() << "Hello from service";
    return 0
}

Last you need to load the server .so file:

<service ... >
    <!-- ... -->
    <meta-data android:name="android.app.lib_name" android:value="server"/>
    <!-- ... -->
</service>

Use QtRemoteObject for communication

We've seen how to create and how to start a Qt on Android service, now let's see how to do the communication between them. There are lots of solutions out there, but for any Qt project, I do recommend you use QtRemoteObject, because it will make your life so easy!

QtRemoteObjects is a playground Qt module led by Ford, for object remoting between processes/devices:

As you can see it's very Qt specific!
Let's see how to add it to your projects and use it.

Get QtRemoteObjects

QtRemoteObjects project is located at http://code.qt.io/cgit/playground/qtremoteobjects.git/, to get it you need to run the following commands:

$ git clone git://code.qt.io/playground/qtremoteobjects.git
$ cd qtremoteobjects
$ ~/Qt/5.7/android_armv7/bin/qmake -r && make && make install

If needed, replace ~/Qt/5.7/android_armv7 with your Qt version and android ABI of choice.

Use QtRemoteObjects

Using QtRemoteObjects is pretty easy, you need to do a few easy steps:

- add QtRemoteObjects to your .pro files

# ...
QT += remoteobjects
# ...

- create .rep file(s)

class PingPong {
    SLOT(void ping(const QString &msg));
    SIGNAL(pong(const QString &msg));
}

- add .rep file(s) to the server .pro file

# ...
REPC_SOURCE += pingpong.rep
# ...

- add .rep file(s) to the client .pro file

# ...
REPC_REPLICA += pingpong.rep
# ...

- QtRemoteObjects source(server) side implementation

#include <QCoreApplication>
#include "rep_pingpong_source.h"

class PingPong : public PingPongSource {
public slots:
    // PingPongSource interface
    void ping(const QString &msg) override {
        emit pong(msg + " from server");
    }
};

int main(int argc, char *argv[])
{
    QCoreApplication app(argc, argv);

    QRemoteObjectHost srcNode(QUrl(QStringLiteral("local:replica")));
    PingPong pingPongServer;
    srcNode.enableRemoting(&pingPongServer);

    return app.exec();
}

Let's check the code a little bit.
First you need to implement all .rep interfaces (PingPongSource), then export PingPong object using enableRemoting.

- QtRemoteObjects replica(client) side implementation

#include "rep_pingpong_replica.h"

// ....
    QRemoteObjectNode repNode;
    repNode.connectToNode(QUrl(QStringLiteral("local:replica")));
    QSharedPointer<PingPongReplica> rep(repNode.acquire<PingPongReplica>());
    bool res = rep->waitForSource();
    Q_ASSERT(res);
    QObject::connect(rep.data(), &PingPongReplica::pong, [](const QString &msg){
        qDebug() << msg;
    });
    rep->ping("Hello");
// ....

Let's check the code:

As you can see, using Qt + QtRemoteObject is (much?) easier and more straight forward than Android's Java services + AIDL 😉

Limitations

Please use the above bug report links to vote for your favorite tasks, the ones that have more votes (usually) are implemented first!

You can find the full source code of this article here: https://github.com/KDAB/android

The post Qt on Android: How to create an Android service using Qt appeared first on KDAB.

28 Sep 2016 12:26pm GMT

New Stable and Development Builds

We've got new builds for you! A new 3.0.1.1 stable release with a number of important bugfixes: the brush-resize lag is gone, templates are there again, loading brush tags works again, the sobel filter is fixed.

And we've got a 3.0.1.90 unstable beta1 release, which includes all the work done by Wolthera (soft proofing, new color dialog, color-managed color picker), Julian (a rewrite of Qt's OpenGL 2D painting subsystem and modernization of Krita's OpenGL canvas) and Jouni (interpolation and keyframing for layers and masks and their properties) for their Google Summer of Code projects, rendering to video, a whole new and very speedy brush engine, the first (slow) version of the lazy-brush coloring mask implementation and much, much more.

Because so much new code got into this beta, we're probably going to have to spend more time than scheduled ironing out all bugs, so please do download and test these builds!

For OSX users, there is only 3.0.1.90 build: because 3.0.2 will be the first release that has the full range of OpenGL-related features, thanks to Julian's Google Summer of Code work, it no longer makes sense to build versions of Krita that do not have this code.

28 Sep 2016 8:42am GMT

RFC: How to fix a tricky leak in QFormLayout?

We have a nasty leak in QFormLayout::setWidget(). In setWidget(), we create the QWidgetItemV2 corresponding to the passed QWidget, and pass that on to Private::setItem, which has a bunch of error returns (guard clauses) that do not delete the item, among them negative row index and cell already occupied.

We could easily fix that missing delete, but this function is also used by setLayout(), say, where the item is the layout.

Conceptually deleting that item (= the nested layout) is completely OK, because the user should be able to rely on the form layout to take ownership of the nested layout, without ifs and buts.

But then we have code in tst_qformlayout that breaks. Simplified, it reads:

   QFormLayout layout;
   QHBoxLayout l4;
   layout.addLayout(-1, QFormLayout::FieldRole, &l4);

I guess you spot the problem? If l4 had been added, everything would've been peachy: The QHBoxLayout destructor unregistered itself from layout, which does not attempt to delete l4 when it itself is deleted.

But if l4 is not added for some reason, like in the test code above, the fixed code will attempt to delete l4, which is undefined behaviour, of course (double-delete).

I think such broken code deserves to be broken, for the greater good of fixing a resource leak. Esp. since a double-delete should complain much louder than a leak, and the API user can do something about the double-delete while she can't do anything about the leak (the pointer is not reachable from outside QFormLayout).

I feel uneasy about adding this to 5.6 LTS, though, so I'll make a minimal fix there, just for setWidget().

What do you think about the larger fix?


Filed under: English, Qt

28 Sep 2016 8:17am GMT

27 Sep 2016

feedPlanet KDE

KDE neon Korean Developer Edition (... and future CJK Edition?)

KDE Project:

While not being advertised on the KDE neon main page just yet (and it won't be for a while), we've recently begun doing regular builds of a special Korean Edition of neon's Developer Edition tracking the stable branch of KDE's code repositories. The Korean Edition pre-selects the Korean language and locale at boot, packs all the Korean translations we have and comes with a Korean input method pre-setup.

Hangeul metal type from the Joseon era
Joseon-era Hangeul metal type

Why a Korean Edition?

Among many other locations around the planet, the local community in Korea is planning to put on a KDE 20th Anniversary birthday party in Seoul on October 14th. The KDE neon Korean Developer Edition was directly created on request for this event, to be made available to attendees.

That said - this is actually something we've been wanting to do for a while, and it's not just about Korean.

None of the bits that make up the new image are new per-se; KDE has supported Korean for a long time, both with foundational localization engineering and regular maintenance activity. And as of the Plasma 5.6 release, our Input Method Panel is finally bundled with the core desktop code and gets automatically added to the panel on first logon in a locale that typically requires an input method.

Yet it's pretty hard to keep all of this working well, as it requires tight integration and testing across an entire stack, with some parts of the whole living upstream or downstream of KDE.org. For example: After we attempted to make the Plasma panel smarter by making it auto-add the Input Method Panel depending on locale, we couldn't actually be sure it was working as desired by our users, as it takes time for distros to get around to tuning their dependency profiles and for feedback from their users to loop back up to us. It's a very long cycle, with too many opportunities to lose focus or domain knowledge to turnover along the way.

This is where KDE neon comes in: As a fully-integrated product, we can now prove out and demo the intended distro experience there. We can make sure thing stay in working order, even before additional work hits our other distro partners.

Right now, we're kicking things off with Korean Edition, but based on time, interest and testers (please get in touch!), we'd like to build it out into a full CJK Edition, with translations and input support for our Chinese and Japanese users pre-installed as well (as another precursor to this, the decision to switch to Noto Sans CJK as Plasma's default typeface last year was very much made with the global audience in mind as well).

Ok, but where do I get it?

Here! Do keep in mind it's alpha. ☺

27 Sep 2016 12:41pm GMT

Kirigami 1.1

Today the first feature update of Kirigami has been released.
We have a lot of bug fixes and some cool new features:

The Menu class features some changes and fixes which give greater control over the action triggered by submenus and leaf nodes in the menu tree. Submenus now know which entry is their parent, and allow the submenu's view to be reset when the application needs it to.
The OverlaySheet now allows to embed ListView and GridView instances in it as well.
The Drawer width now is standardized so all applications look coherent from one another and the title now elides if it doesn't fit. We also introduced the GlobalDrawer.bannerClicked signal to let applications react to banner interaction.
SwipeListItem has been polished to make sure its contents can fit to the space they have and we introduced the Separator component.
Desktop Kirigami applications support the "quit" shortcut (such as Ctrl+Q) now.

Plasma 5.8 will depend from Kirigami 1.1, so if you are planning to write a Kirigami-based application, it will work by default and nicely integrate in the Plasma 5.8 desktop.

Plasma 5.8 also has a new big user for Kirigami 1.1, that is Discover: the application to search and install for new software, has a brand new user interface, based upon Kirigami.

plasma-5-8-discover

This is problably the last feature release based upon QtQuickControls 1, QtQuickControls 2 version is on the way at an experimental stage. The port will have way simpler code (and smaller memory footprint) but this is an entry for another day 🙂

27 Sep 2016 12:07pm GMT