D5712: Validate surface is valid when sending TextInput leave event

2017-05-04 Thread Martin Gräßlin
graesslin requested changes to this revision.
graesslin added a comment.
This revision now requires changes to proceed.


  Please add a unit test case.

REPOSITORY
  R127 KWayland

REVISION DETAIL
  https://phabricator.kde.org/D5712

To: davidedmundson, #plasma, graesslin
Cc: graesslin, plasma-devel, #frameworks, spstarr, progwolff, Zren, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, eliasp, sebas, apol, lukas


Re: Review Request 130084: Add a pair of flags forcing fsync during copy loop

2017-05-04 Thread KJ Tsanaktsidis


> On April 15, 2017, 8:30 a.m., David Faure wrote:
> > But doesn't this make copying much slower in the normal case? (copying onto 
> > a non-removable harddisk partition).
> > 
> > It sounds to me like this should be
> > 1) done internally in kio_file (no Job API for this)
> > 2) only when the destination is a removable device
> 
> Oswald Buddenhagen wrote:
> i've read multiple times that fsync isn't a performance problem on modern 
> file systems any more. whatever that may mean.
> limiting this to cross-device isn't really sensible imo - a) one can have 
> multiple internal disks and b) even if the disk stays in, at some point the 
> flushing will commence and will be a major slowdown for subsequent operations.
> in fact, this problem is bad enough that the linux kernel community 
> realized it (which, in the area of disk i/o, never ceases to amaze) - 
> https://lwn.net/Articles/682582/ (obvious followup question: what kernel do 
> you use? this code seems to have landed in 4.10)
> 
> KJ Tsanaktsidis wrote:
> I'm using kernel `Linux kj-hedt-arch 4.10.8-1-ARCH #1 SMP PREEMPT Fri Mar 
> 31 16:50:19 CEST 2017 x86_64 GNU/Linux`. My understanding is that the 
> patchset you're talking about will not allow synchronous reads, such as 
> faulting in application code, to get stuck behind a full writeback queue, by 
> limiting how much work the MM subsystem can send to the disk - not by 
> throttling how fast applications can dirty the device. I've not noticed any 
> problems using the disk whilst writing with or without my patch to KIO here 
> but I haven't really stressed it.
> 
> As to what the performance implications of fsync - I guess it depends how 
> much you care about what you were planning to do with the file after you copy 
> it. I implemented the "fsync if source/dest are on different filesystems" 
> logic because in that case, one of the things you might be wanting to do is 
> unmount the disk. If you wanted to interact with the file on the destination 
> system instead, this patch would make it take (much) longer. The reason I 
> implemented this with a job flag is that I was envisiging making it an option 
> in Dolphin - like the "move/copy" menu when you drop, you could also get 
> "copy with fsync" perhaps for this reason - we don't know what the user plans 
> to do with the file afterwards.
> 
> I'm happy enough to use "is the device removeable?" as a heuristic for 
> "the users next desired operation on this file is probably to unmount it" 
> instead and delete the Job API - this would address my use case at least. How 
> do you suggest I get this information in `kio_file`? On Linux it looks like I 
> can get this from sysfs `/sys/dev/block/maj:min/removeable`, but I don't know 
> how to do this for other platforms and don't have them available to test. 
> Would the patch be OK if I just added this for linux?
> 
> David Faure wrote:
> Solid has portable API for this. 
> Something like this (completely untested, I'm no Solid expert, these are 
> just old notes from a TODO)
> 
> const QString query = QLatin1String("[StorageAccess.accessible == 
> true]");
> const QList lst = Solid::Device::listFromQuery(query);
> iterating and then using Solid::StorageDrive::isRemovable() || 
> Solid::StorageDrive::isHotpluggable() (these checks can probably be 
> integrated into the query string)
> 
> KJ Tsanaktsidis wrote:
> OK - that seems reasonable enough. I guess I should be able to search 
> Solid's disks for the major/minor numbers from `fstat`'s `st_dev`. Whilst 
> doing this I ran into a bug with Solid, which I've proposed a patch for here: 
> https://git.reviewboard.kde.org/r/130090/. If that gets OK'd I'll come back 
> to finishing this off :)

OK - the dependant patch to Solid https://git.reviewboard.kde.org/r/130090/ has 
been committed. I think we can try pushing this forward now?


- KJ


---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/130084/#review103048
---


On April 17, 2017, 11:27 a.m., KJ Tsanaktsidis wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/130084/
> ---
> 
> (Updated April 17, 2017, 11:27 a.m.)
> 
> 
> Review request for KDE Frameworks, Oswald Buddenhagen and Thiago Macieira.
> 
> 
> Repository: kio
> 
> 
> Description
> ---
> 
> When copying a large-ish file (~1-2GB) from very fast storage to very slow 
> storage (e.g. an NVME SSD to a cheap USB flash drive) on a machine with lots 
> of RAM, Dolphin displays a progress bar which finishes in a fraction of a 
> second (i.e. as fast as it takes to read the source file into the Linux page 
> cache). Unmounting the drive 

D5712: Validate surface is valid when sending TextInput leave event

2017-05-04 Thread David Edmundson
davidedmundson created this revision.
Restricted Application added projects: Plasma on Wayland, Frameworks.
Restricted Application added subscribers: Frameworks, plasma-devel.

REVISION SUMMARY
  It's possible for the surface to be unbound when we send the leave
  event; we've called Resource::unbind() of Surface, so the Surface has,
  deleteLater called, but it's still a valid object, and the first check
  passes.
  
  We get in this situation because when a surface is destroyed, we're
  handling text input from the same source event.
  
  Sending a nullpointer is a protocol error, and wayland kindly closes the
  connection.
  
  This fixes my constant:
  "Did the Wayland server die" error messages when running clients.

TEST PLAN
  Got errors after setting up qt virtual keyboard.
  Had reproducible case.
  Restarted kwin after this patch, now doesn't crash.

REPOSITORY
  R127 KWayland

BRANCH
  davidedmundson/xdgv6

REVISION DETAIL
  https://phabricator.kde.org/D5712

AFFECTED FILES
  src/server/textinput_interface_v2.cpp

To: davidedmundson, #plasma
Cc: plasma-devel, #frameworks, spstarr, progwolff, Zren, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, eliasp, sebas, apol, lukas


D5638: Use a single QNAM (and a disk cache) for HTTP jobs

2017-05-04 Thread Aleix Pol Gonzalez
apol added inline comments.

INLINE COMMENTS

> httpworker.cpp:36
> +HTTPWorkerNAM()
> +: nam(new QNetworkAccessManager)
> +, mutex(new QMutex)

These all are leaking.

> httpworker.cpp:48
> +QNetworkAccessManager* nam;
> +QMutex* mutex;
> +

Drop *, leaking mutexes

REPOSITORY
  R304 KNewStuff

REVISION DETAIL
  https://phabricator.kde.org/D5638

To: leinir, whiting, apol
Cc: #frameworks


Re: Deploy Weblate/Pootle system for translation

2017-05-04 Thread Luigi Toscano
On Thursday, 4 May 2017 16:59:58 CEST Guo Yunhe wrote:
> Dear developers,
> 
> I am from Chinese localization team. Recently, we meet some new contributors
> and they are not so skilled with SVN. This let me to think how we can make
> translation process easier.
> 
> Mozilla has its own online translation system. LibreOffice uses Pootle.
> openSUSE project uses Weblate. A lot of other projects use Transifex or
> Crowdin. These system are well designed. Anyone with basic computer
> knowledge can start to contribute. All discussions are open. It enable
> different opinions to display and avoid arbitrary.
> 
> However, our SVN is stopping people from contributing. Not only techniques
> but also transparency. When here are some disagreement on specific
> translation, usually those who have SVN commit permission can choose the
> option they prefer. Sometimes it is disappointing.

I'm sorry for that, and I have nothing against a web system (apart from the 
fact that I find it defintely less flexible than offline system) but please 
note that :
- you can discuss openly on a mailing list;
- the web system does not magically solve the conflicts. A reviewer can still 
decide at the end. In our system, whather will be, people with developer 
account will be responsible to accept the reviews (the equivalent of commit).

So I don't think that it will your problem about disagreements, but anyway, 
see below for the technical issues.

> 
> So I strongly suggest to make KDE's own online translation platform. And I
> would like to know ideas from other contributors.

As already pointed out, please check the archives for this discussion in the 
past.

We have a list of requirements that *must* be satisfied:
https://marc.info/?l=kde-i18n-doc=143561152919896=2

They basically say that the web tool should not interfere with manual changes 
done under the hood, and not lose translations because of them. 

If you can implement those requirements with a proof of concept, sure, we can 
try it.


-- 
Luigi



Android bulding guide

2017-05-04 Thread Fernando Theirs
Hi everyone!

I'm working with Qt and I have to port a Linux application to Android.
Basically I need to manage some compressed files (targz, zip, among others)
and in Qt Forum they recommend me to use KArchive.

I started working with Qt only a year ago and I'm still a rookie. I could
not find binaries for this library and the source code uses CMake (I was
expecting a .pro :/) so it's getting really hard for me to get it work.

Asking to the same guy that recommended me the library and following his
indications I could compile KArchive for Linux and I'm testing it but I
can't understand very well the documentation.

1) Using KTar I could create a tar.gz with two txt files with the following
code:

QString input =   "/home/ferni/QtBuild/KArchiveTest/testTar.txt";
QString input2 = "/home/ferni/QtBuild/KArchiveTest/testTar2.txt";
QString output = "/home/ferni/QtBuild/KArchiveTest/testTar.tar.gz";

KTar archive(output, "application/x-gzip");
// Prepare the archive for writing.
if (!archive.open(QIODevice::ReadOnly)) {
 // Failed to open file.
 return 1;
 }

// Create or open an archive
archive.addLocalFile(input, input);
archive.addLocalFile(input2, input2);
archive.close();

My question is: how can I decompress the file that I created?

2) Is there a building tutorial to compile KArchive for Android? If not,
can someone guide me to do this or just shared the binaries for Android? I
tried to create a .pro file and include the sources but I got many errors
about missing files :/

Thanks in advance!
Fernando


Re: Deploy Weblate/Pootle system for translation

2017-05-04 Thread Frederik Schwarzer
On Donnerstag, 4. Mai 2017 17:59:58 CEST Guo Yunhe wrote:

Hi,

this discussion would be a better fit for kde-i18n-...@kde.org.

> However, our SVN is stopping people from contributing. Not only techniques
> but also transparency. When here are some disagreement on specific
> translation, usually those who have SVN commit permission can choose the
> option they prefer. Sometimes it is disappointing.

Just want to point out here that disputes are not better dealt with in web 
translation systems. It's like saying, in SVN, if two people disagree, just 
give them both access and the problem will go away.
Just do not solve people problems with technical solutions.

As for the rest ... this topic is coming up every once in a while, so the mail 
archive of kde-i18n-...@kde.org is full of pro and con arguments. For me it's 
a matter of taste and I did not see a system yet that I like.

Cheers,
Frederik




Deploy Weblate/Pootle system for translation

2017-05-04 Thread Guo Yunhe
Dear developers,

I am from Chinese localization team. Recently, we meet some new contributors 
and they are not so skilled with SVN. This let me to think how we can make 
translation process easier.

Mozilla has its own online translation system. LibreOffice uses Pootle. 
openSUSE project uses Weblate. A lot of other projects use Transifex or 
Crowdin. These system are well designed. Anyone with basic computer knowledge 
can start to contribute. All discussions are open. It enable different opinions 
to display and avoid arbitrary.

However, our SVN is stopping people from contributing. Not only techniques but 
also transparency. When here are some disagreement on specific translation, 
usually those who have SVN commit permission can choose the option they prefer. 
Sometimes it is disappointing.

So I strongly suggest to make KDE's own online translation platform. And I 
would like to know ideas from other contributors.

Thanks!

-- 
Guo Yunhe
Aalto University
Espoo, Finland


Jenkins-kde-ci: libkscreen master kf5-qt5 » Linux,gcc - Build # 55 - Still Unstable!

2017-05-04 Thread no-reply

GENERAL INFO

BUILD UNSTABLE
Build URL: 
https://build.kde.org/job/libkscreen%20master%20kf5-qt5/PLATFORM=Linux,compiler=gcc/55/
Project: PLATFORM=Linux,compiler=gcc
Date of build: Thu, 04 May 2017 12:49:28 +
Build duration: 6 min 34 sec

CHANGE SET
Revision 4ef1c0447748b4b10459bf5efe2c07da88d78166 by David Edmundson: (Sync 
wayland output scale to KScreen config)
  change: edit backends/kwayland/waylandoutput.cpp
Revision 4a9f18f93948259142a29b24be6005987e955884 by David Edmundson: (Fix 
Output::geometry() when dealing with a scaled monitor)
  change: edit src/output.cpp
Revision cd4f61871bbf74882c3823d68b0a3fec47613f44 by David Edmundson: (Fix 
compile warning of treating boolean like an integer)
  change: edit src/doctor/dpmsclient.h


JUNIT RESULTS

Name: (root) Failed: 2 test(s), Passed: 10 test(s), Skipped: 0 test(s), Total: 
12 test(s)Failed: TestSuite.kscreen-testkwaylanddpmsFailed: 
TestSuite.kscreen-testscreenconfig

COBERTURA RESULTS

Cobertura Coverage Report
  PACKAGES 7/7 (100%)FILES 49/50 (98%)CLASSES 49/50 (98%)LINE 3030/3732 
(81%)CONDITIONAL 1594/2986 (53%)

By packages
  
autotests
FILES 10/10 (100%)CLASSES 10/10 (100%)LINE 1065/1096 
(97%)CONDITIONAL 636/1260 (50%)
backends.fake
FILES 2/2 (100%)CLASSES 2/2 (100%)LINE 149/237 (63%)CONDITIONAL 
95/188 (51%)
backends.kwayland
FILES 5/5 (100%)CLASSES 5/5 (100%)LINE 275/334 (82%)CONDITIONAL 
100/164 (61%)
backends.qscreen
FILES 4/4 (100%)CLASSES 4/4 (100%)LINE 120/157 (76%)CONDITIONAL 
38/96 (40%)
src
FILES 22/22 (100%)CLASSES 22/22 (100%)LINE 1157/1576 
(73%)CONDITIONAL 563/1028 (55%)
src.backendlauncher
FILES 3/4 (75%)CLASSES 3/4 (75%)LINE 70/123 (57%)CONDITIONAL 
20/80 (25%)
tests.kwayland
FILES 3/3 (100%)CLASSES 3/3 (100%)LINE 194/209 (93%)CONDITIONAL 
142/170 (84%)

Jenkins-kde-ci: solid master stable-kf5-qt5 » Linux,gcc - Build # 182 - Fixed!

2017-05-04 Thread no-reply

GENERAL INFO

BUILD SUCCESS
Build URL: 
https://build.kde.org/job/solid%20master%20stable-kf5-qt5/PLATFORM=Linux,compiler=gcc/182/
Project: PLATFORM=Linux,compiler=gcc
Date of build: Thu, 04 May 2017 12:46:53 +
Build duration: 2 min 36 sec

CHANGE SET
Revision 929ce607e9cd8019fdbe6bc49822474deee9b745 by lamarque: (Adding files 
missing from last commit.)
  change: add autotests/fakeUdisks2.h
  change: add autotests/solidudisks2test.cpp
  change: add autotests/fakeUdisks2.cpp


JUNIT RESULTS

Name: (root) Failed: 0 test(s), Passed: 5 test(s), Skipped: 0 test(s), Total: 5 
test(s)

COBERTURA RESULTS

Cobertura Coverage Report
  PACKAGES 11/11 (100%)FILES 101/148 (68%)CLASSES 101/148 (68%)LINE 1870/4855 
(39%)CONDITIONAL 1044/3933 (27%)

By packages
  
autotests
FILES 8/8 (100%)CLASSES 8/8 (100%)LINE 363/367 (99%)CONDITIONAL 
221/432 (51%)
src.solid.devices
FILES 2/2 (100%)CLASSES 2/2 (100%)LINE 100/120 (83%)CONDITIONAL 
23/40 (58%)
src.solid.devices.backends.fakehw
FILES 17/17 (100%)CLASSES 17/17 (100%)LINE 348/667 
(52%)CONDITIONAL 193/494 (39%)
src.solid.devices.backends.fstab
FILES 4/8 (50%)CLASSES 4/8 (50%)LINE 71/332 (21%)CONDITIONAL 
35/202 (17%)
src.solid.devices.backends.shared
FILES 2/5 (40%)CLASSES 2/5 (40%)LINE 91/344 (26%)CONDITIONAL 
31/160 (19%)
src.solid.devices.backends.udev
FILES 4/11 (36%)CLASSES 4/11 (36%)LINE 112/389 (29%)CONDITIONAL 
116/448 (26%)
src.solid.devices.backends.udisks2
FILES 6/14 (43%)CLASSES 6/14 (43%)LINE 189/1327 
(14%)CONDITIONAL 96/1233 (8%)
src.solid.devices.backends.udisks2.dbus
FILES 2/2 (100%)CLASSES 2/2 (100%)LINE 7/10 (70%)CONDITIONAL 
1/2 (50%)
src.solid.devices.backends.upower
FILES 1/7 (14%)CLASSES 1/7 (14%)LINE 19/346 (5%)CONDITIONAL 
11/213 (5%)
src.solid.devices.frontend
FILES 27/46 (59%)CLASSES 27/46 (59%)LINE 515/870 
(59%)CONDITIONAL 279/565 (49%)
src.solid.devices.ifaces
FILES 28/28 (100%)CLASSES 28/28 (100%)LINE 55/83 
(66%)CONDITIONAL 38/144 (26%)

Re: Review Request 130090: Fix incorrect definition of major(3)/minor(3) macros

2017-05-04 Thread Lamarque Souza


> On May 4, 2017, 12:40 p.m., Albert Astals Cid wrote:
> > Lamarque, you broke the build.

Fixed. Thanks for the quick report about the broken build and sorry for not 
adding all files to the commit.


- Lamarque


---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/130090/#review103182
---


On May 4, 2017, 12:32 p.m., KJ Tsanaktsidis wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/130090/
> ---
> 
> (Updated May 4, 2017, 12:32 p.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: solid
> 
> 
> Description
> ---
> 
> Previously, udesksblock.cpp was attempting to find a definition for
> major/minor on Linux in  by checking Q_OS_LINUX before
> importing the header. Q_OS_LINUX is however only set when
> qsystemdetection.h is included, and the macro was being checked first.
> 
> Even had this check worked, it would still be wrong. On a modern version
> of the userspace linux-headers,  includes definitions for
> major and minor that assume each is limited to 8 bits and that dev_t is
> 16 bits. This is no longer true anymore; on Linux, major numbers can be
> up to 12 bits at present and minor numbers up to 20. Calling these
> macros with dev_t values > 2^16 would give incorrect results.
> 
> Because the Q_OS_LINUX check failed, a fallback version of the macros
> were defined for use on all platforms. The code is allegedly copied from
> kdev_t.h, except it is copied from the *kernel* version of the header,
> not the userspace version. Linux internally uses a different
> representation of dev_t than it exposes to userspace - the kernelspace
> version is 20 bits of minor/12 bits of major contiguously, but the
> userspace version packs the bits in a different order to maintain
> compatability with old 16-bit device numbers. Thus, this code also does
> not work for dev_t values > 2^16.
> 
> To fix this, we add CMake rules to search for a system-provided
> definition of the major/minor macros - on various systems, these can be
> in a few different places. As a fallback, we assume old-style 16-bit
> dev_t (although I suspect that is only used for Windows, where
> major/minor numbers are pretty meaningless anyway).
> 
> 
> Diffs
> -
> 
>   autotests/CMakeLists.txt 54adeea62b954b9169b37f1eab8fa3e215fafafa 
>   autotests/fakeUdisks2.h PRE-CREATION 
>   autotests/fakeUdisks2.cpp PRE-CREATION 
>   autotests/solidudisks2test.cpp PRE-CREATION 
>   src/solid/devices/backends/udisks2/CMakeLists.txt 
> 34390064af29ace07cbb3470945be098cc606d04 
>   src/solid/devices/backends/udisks2/udisksblock.cpp 
> 0622ec77fcf670a2005d34b7a6c31ca8b53a18d8 
> 
> Diff: https://git.reviewboard.kde.org/r/130090/diff/
> 
> 
> Testing
> ---
> 
> I've written a little snippet to iterate through block devices, print their 
> major/minor number, and their device properties. It was previously 
> incorrectly labeling all my disks with major 0 and minor == device_number 
> (since it was using the first 20 bits for the minor). It now correctly 
> identifies their major/minor number.
> 
> 
> Thanks,
> 
> KJ Tsanaktsidis
> 
>



Jenkins-kde-ci: solid master stable-kf5-qt5 » Linux,gcc - Build # 182 - Fixed!

2017-05-04 Thread no-reply

GENERAL INFO

BUILD SUCCESS
Build URL: 
https://build.kde.org/job/solid%20master%20stable-kf5-qt5/PLATFORM=Linux,compiler=gcc/182/
Project: PLATFORM=Linux,compiler=gcc
Date of build: Thu, 04 May 2017 12:46:53 +
Build duration: 2 min 36 sec

CHANGE SET
Revision 929ce607e9cd8019fdbe6bc49822474deee9b745 by lamarque: (Adding files 
missing from last commit.)
  change: add autotests/fakeUdisks2.h
  change: add autotests/solidudisks2test.cpp
  change: add autotests/fakeUdisks2.cpp


JUNIT RESULTS

Name: (root) Failed: 0 test(s), Passed: 5 test(s), Skipped: 0 test(s), Total: 5 
test(s)

COBERTURA RESULTS

Cobertura Coverage Report
  PACKAGES 11/11 (100%)FILES 101/148 (68%)CLASSES 101/148 (68%)LINE 1870/4855 
(39%)CONDITIONAL 1044/3933 (27%)

By packages
  
autotests
FILES 8/8 (100%)CLASSES 8/8 (100%)LINE 363/367 (99%)CONDITIONAL 
221/432 (51%)
src.solid.devices
FILES 2/2 (100%)CLASSES 2/2 (100%)LINE 100/120 (83%)CONDITIONAL 
23/40 (58%)
src.solid.devices.backends.fakehw
FILES 17/17 (100%)CLASSES 17/17 (100%)LINE 348/667 
(52%)CONDITIONAL 193/494 (39%)
src.solid.devices.backends.fstab
FILES 4/8 (50%)CLASSES 4/8 (50%)LINE 71/332 (21%)CONDITIONAL 
35/202 (17%)
src.solid.devices.backends.shared
FILES 2/5 (40%)CLASSES 2/5 (40%)LINE 91/344 (26%)CONDITIONAL 
31/160 (19%)
src.solid.devices.backends.udev
FILES 4/11 (36%)CLASSES 4/11 (36%)LINE 112/389 (29%)CONDITIONAL 
116/448 (26%)
src.solid.devices.backends.udisks2
FILES 6/14 (43%)CLASSES 6/14 (43%)LINE 189/1327 
(14%)CONDITIONAL 96/1233 (8%)
src.solid.devices.backends.udisks2.dbus
FILES 2/2 (100%)CLASSES 2/2 (100%)LINE 7/10 (70%)CONDITIONAL 
1/2 (50%)
src.solid.devices.backends.upower
FILES 1/7 (14%)CLASSES 1/7 (14%)LINE 19/346 (5%)CONDITIONAL 
11/213 (5%)
src.solid.devices.frontend
FILES 27/46 (59%)CLASSES 27/46 (59%)LINE 515/870 
(59%)CONDITIONAL 279/565 (49%)
src.solid.devices.ifaces
FILES 28/28 (100%)CLASSES 28/28 (100%)LINE 55/83 
(66%)CONDITIONAL 38/144 (26%)

Jenkins-kde-ci: solid master kf5-qt5 » Linux,gcc - Build # 183 - Fixed!

2017-05-04 Thread no-reply

GENERAL INFO

BUILD SUCCESS
Build URL: 
https://build.kde.org/job/solid%20master%20kf5-qt5/PLATFORM=Linux,compiler=gcc/183/
Project: PLATFORM=Linux,compiler=gcc
Date of build: Thu, 04 May 2017 12:46:53 +
Build duration: 2 min 37 sec

CHANGE SET
Revision 929ce607e9cd8019fdbe6bc49822474deee9b745 by lamarque: (Adding files 
missing from last commit.)
  change: add autotests/fakeUdisks2.h
  change: add autotests/fakeUdisks2.cpp
  change: add autotests/solidudisks2test.cpp


JUNIT RESULTS

Name: (root) Failed: 0 test(s), Passed: 5 test(s), Skipped: 0 test(s), Total: 5 
test(s)

COBERTURA RESULTS

Cobertura Coverage Report
  PACKAGES 11/11 (100%)FILES 101/148 (68%)CLASSES 101/148 (68%)LINE 1870/4855 
(39%)CONDITIONAL 1043/3933 (27%)

By packages
  
autotests
FILES 8/8 (100%)CLASSES 8/8 (100%)LINE 363/367 (99%)CONDITIONAL 
221/432 (51%)
src.solid.devices
FILES 2/2 (100%)CLASSES 2/2 (100%)LINE 100/120 (83%)CONDITIONAL 
23/40 (58%)
src.solid.devices.backends.fakehw
FILES 17/17 (100%)CLASSES 17/17 (100%)LINE 348/667 
(52%)CONDITIONAL 193/494 (39%)
src.solid.devices.backends.fstab
FILES 4/8 (50%)CLASSES 4/8 (50%)LINE 71/332 (21%)CONDITIONAL 
35/202 (17%)
src.solid.devices.backends.shared
FILES 2/5 (40%)CLASSES 2/5 (40%)LINE 91/344 (26%)CONDITIONAL 
31/160 (19%)
src.solid.devices.backends.udev
FILES 4/11 (36%)CLASSES 4/11 (36%)LINE 112/389 (29%)CONDITIONAL 
116/448 (26%)
src.solid.devices.backends.udisks2
FILES 6/14 (43%)CLASSES 6/14 (43%)LINE 189/1327 
(14%)CONDITIONAL 96/1233 (8%)
src.solid.devices.backends.udisks2.dbus
FILES 2/2 (100%)CLASSES 2/2 (100%)LINE 7/10 (70%)CONDITIONAL 
1/2 (50%)
src.solid.devices.backends.upower
FILES 1/7 (14%)CLASSES 1/7 (14%)LINE 19/346 (5%)CONDITIONAL 
11/213 (5%)
src.solid.devices.frontend
FILES 27/46 (59%)CLASSES 27/46 (59%)LINE 515/870 
(59%)CONDITIONAL 278/565 (49%)
src.solid.devices.ifaces
FILES 28/28 (100%)CLASSES 28/28 (100%)LINE 55/83 
(66%)CONDITIONAL 38/144 (26%)

Jenkins-kde-ci: solid master kf5-qt5 » Linux,gcc - Build # 183 - Fixed!

2017-05-04 Thread no-reply

GENERAL INFO

BUILD SUCCESS
Build URL: 
https://build.kde.org/job/solid%20master%20kf5-qt5/PLATFORM=Linux,compiler=gcc/183/
Project: PLATFORM=Linux,compiler=gcc
Date of build: Thu, 04 May 2017 12:46:53 +
Build duration: 2 min 37 sec

CHANGE SET
Revision 929ce607e9cd8019fdbe6bc49822474deee9b745 by lamarque: (Adding files 
missing from last commit.)
  change: add autotests/fakeUdisks2.h
  change: add autotests/fakeUdisks2.cpp
  change: add autotests/solidudisks2test.cpp


JUNIT RESULTS

Name: (root) Failed: 0 test(s), Passed: 5 test(s), Skipped: 0 test(s), Total: 5 
test(s)

COBERTURA RESULTS

Cobertura Coverage Report
  PACKAGES 11/11 (100%)FILES 101/148 (68%)CLASSES 101/148 (68%)LINE 1870/4855 
(39%)CONDITIONAL 1043/3933 (27%)

By packages
  
autotests
FILES 8/8 (100%)CLASSES 8/8 (100%)LINE 363/367 (99%)CONDITIONAL 
221/432 (51%)
src.solid.devices
FILES 2/2 (100%)CLASSES 2/2 (100%)LINE 100/120 (83%)CONDITIONAL 
23/40 (58%)
src.solid.devices.backends.fakehw
FILES 17/17 (100%)CLASSES 17/17 (100%)LINE 348/667 
(52%)CONDITIONAL 193/494 (39%)
src.solid.devices.backends.fstab
FILES 4/8 (50%)CLASSES 4/8 (50%)LINE 71/332 (21%)CONDITIONAL 
35/202 (17%)
src.solid.devices.backends.shared
FILES 2/5 (40%)CLASSES 2/5 (40%)LINE 91/344 (26%)CONDITIONAL 
31/160 (19%)
src.solid.devices.backends.udev
FILES 4/11 (36%)CLASSES 4/11 (36%)LINE 112/389 (29%)CONDITIONAL 
116/448 (26%)
src.solid.devices.backends.udisks2
FILES 6/14 (43%)CLASSES 6/14 (43%)LINE 189/1327 
(14%)CONDITIONAL 96/1233 (8%)
src.solid.devices.backends.udisks2.dbus
FILES 2/2 (100%)CLASSES 2/2 (100%)LINE 7/10 (70%)CONDITIONAL 
1/2 (50%)
src.solid.devices.backends.upower
FILES 1/7 (14%)CLASSES 1/7 (14%)LINE 19/346 (5%)CONDITIONAL 
11/213 (5%)
src.solid.devices.frontend
FILES 27/46 (59%)CLASSES 27/46 (59%)LINE 515/870 
(59%)CONDITIONAL 278/565 (49%)
src.solid.devices.ifaces
FILES 28/28 (100%)CLASSES 28/28 (100%)LINE 55/83 
(66%)CONDITIONAL 38/144 (26%)

Re: Review Request 130090: Fix incorrect definition of major(3)/minor(3) macros

2017-05-04 Thread Albert Astals Cid

---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/130090/#review103182
---



Lamarque, you broke the build.

- Albert Astals Cid


On May 4, 2017, 12:32 p.m., KJ Tsanaktsidis wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/130090/
> ---
> 
> (Updated May 4, 2017, 12:32 p.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: solid
> 
> 
> Description
> ---
> 
> Previously, udesksblock.cpp was attempting to find a definition for
> major/minor on Linux in  by checking Q_OS_LINUX before
> importing the header. Q_OS_LINUX is however only set when
> qsystemdetection.h is included, and the macro was being checked first.
> 
> Even had this check worked, it would still be wrong. On a modern version
> of the userspace linux-headers,  includes definitions for
> major and minor that assume each is limited to 8 bits and that dev_t is
> 16 bits. This is no longer true anymore; on Linux, major numbers can be
> up to 12 bits at present and minor numbers up to 20. Calling these
> macros with dev_t values > 2^16 would give incorrect results.
> 
> Because the Q_OS_LINUX check failed, a fallback version of the macros
> were defined for use on all platforms. The code is allegedly copied from
> kdev_t.h, except it is copied from the *kernel* version of the header,
> not the userspace version. Linux internally uses a different
> representation of dev_t than it exposes to userspace - the kernelspace
> version is 20 bits of minor/12 bits of major contiguously, but the
> userspace version packs the bits in a different order to maintain
> compatability with old 16-bit device numbers. Thus, this code also does
> not work for dev_t values > 2^16.
> 
> To fix this, we add CMake rules to search for a system-provided
> definition of the major/minor macros - on various systems, these can be
> in a few different places. As a fallback, we assume old-style 16-bit
> dev_t (although I suspect that is only used for Windows, where
> major/minor numbers are pretty meaningless anyway).
> 
> 
> Diffs
> -
> 
>   autotests/CMakeLists.txt 54adeea62b954b9169b37f1eab8fa3e215fafafa 
>   autotests/fakeUdisks2.h PRE-CREATION 
>   autotests/fakeUdisks2.cpp PRE-CREATION 
>   autotests/solidudisks2test.cpp PRE-CREATION 
>   src/solid/devices/backends/udisks2/CMakeLists.txt 
> 34390064af29ace07cbb3470945be098cc606d04 
>   src/solid/devices/backends/udisks2/udisksblock.cpp 
> 0622ec77fcf670a2005d34b7a6c31ca8b53a18d8 
> 
> Diff: https://git.reviewboard.kde.org/r/130090/diff/
> 
> 
> Testing
> ---
> 
> I've written a little snippet to iterate through block devices, print their 
> major/minor number, and their device properties. It was previously 
> incorrectly labeling all my disks with major 0 and minor == device_number 
> (since it was using the first 20 bits for the minor). It now correctly 
> identifies their major/minor number.
> 
> 
> Thanks,
> 
> KJ Tsanaktsidis
> 
>



Jenkins-kde-ci: solid master stable-kf5-qt5 » Linux,gcc - Build # 181 - Failure!

2017-05-04 Thread no-reply

GENERAL INFO

BUILD FAILURE
Build URL: 
https://build.kde.org/job/solid%20master%20stable-kf5-qt5/PLATFORM=Linux,compiler=gcc/181/
Project: PLATFORM=Linux,compiler=gcc
Date of build: Thu, 04 May 2017 12:32:38 +
Build duration: 50 sec

CHANGE SET
Revision 3c1e1648a94c474c9270e203e9462285cd5d0619 by lamarque: (Fix incorrect 
definition of major(3)/minor(3) macros.)
  change: edit src/solid/devices/backends/udisks2/CMakeLists.txt
  change: edit src/solid/devices/backends/udisks2/udisksblock.cpp
  change: edit autotests/CMakeLists.txt


Jenkins-kde-ci: solid master kf5-qt5 » Linux,gcc - Build # 182 - Failure!

2017-05-04 Thread no-reply

GENERAL INFO

BUILD FAILURE
Build URL: 
https://build.kde.org/job/solid%20master%20kf5-qt5/PLATFORM=Linux,compiler=gcc/182/
Project: PLATFORM=Linux,compiler=gcc
Date of build: Thu, 04 May 2017 12:32:38 +
Build duration: 21 sec

CHANGE SET
Revision 3c1e1648a94c474c9270e203e9462285cd5d0619 by lamarque: (Fix incorrect 
definition of major(3)/minor(3) macros.)
  change: edit src/solid/devices/backends/udisks2/CMakeLists.txt
  change: edit autotests/CMakeLists.txt
  change: edit src/solid/devices/backends/udisks2/udisksblock.cpp


Re: Review Request 130090: Fix incorrect definition of major(3)/minor(3) macros

2017-05-04 Thread KJ Tsanaktsidis

---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/130090/
---

(Updated May 4, 2017, 12:32 p.m.)


Status
--

This change has been marked as submitted.


Review request for KDE Frameworks.


Changes
---

Submitted with commit 3c1e1648a94c474c9270e203e9462285cd5d0619 by Lamarque V. 
Souza on behalf of Konstantinos Tsanaktsidis to branch master.


Repository: solid


Description
---

Previously, udesksblock.cpp was attempting to find a definition for
major/minor on Linux in  by checking Q_OS_LINUX before
importing the header. Q_OS_LINUX is however only set when
qsystemdetection.h is included, and the macro was being checked first.

Even had this check worked, it would still be wrong. On a modern version
of the userspace linux-headers,  includes definitions for
major and minor that assume each is limited to 8 bits and that dev_t is
16 bits. This is no longer true anymore; on Linux, major numbers can be
up to 12 bits at present and minor numbers up to 20. Calling these
macros with dev_t values > 2^16 would give incorrect results.

Because the Q_OS_LINUX check failed, a fallback version of the macros
were defined for use on all platforms. The code is allegedly copied from
kdev_t.h, except it is copied from the *kernel* version of the header,
not the userspace version. Linux internally uses a different
representation of dev_t than it exposes to userspace - the kernelspace
version is 20 bits of minor/12 bits of major contiguously, but the
userspace version packs the bits in a different order to maintain
compatability with old 16-bit device numbers. Thus, this code also does
not work for dev_t values > 2^16.

To fix this, we add CMake rules to search for a system-provided
definition of the major/minor macros - on various systems, these can be
in a few different places. As a fallback, we assume old-style 16-bit
dev_t (although I suspect that is only used for Windows, where
major/minor numbers are pretty meaningless anyway).


Diffs
-

  autotests/CMakeLists.txt 54adeea62b954b9169b37f1eab8fa3e215fafafa 
  autotests/fakeUdisks2.h PRE-CREATION 
  autotests/fakeUdisks2.cpp PRE-CREATION 
  autotests/solidudisks2test.cpp PRE-CREATION 
  src/solid/devices/backends/udisks2/CMakeLists.txt 
34390064af29ace07cbb3470945be098cc606d04 
  src/solid/devices/backends/udisks2/udisksblock.cpp 
0622ec77fcf670a2005d34b7a6c31ca8b53a18d8 

Diff: https://git.reviewboard.kde.org/r/130090/diff/


Testing
---

I've written a little snippet to iterate through block devices, print their 
major/minor number, and their device properties. It was previously incorrectly 
labeling all my disks with major 0 and minor == device_number (since it was 
using the first 20 bits for the minor). It now correctly identifies their 
major/minor number.


Thanks,

KJ Tsanaktsidis



Re: Review Request 130090: Fix incorrect definition of major(3)/minor(3) macros

2017-05-04 Thread KJ Tsanaktsidis


> On April 28, 2017, 1:28 p.m., Lamarque Souza wrote:
> > Ship It!
> 
> KJ Tsanaktsidis wrote:
> Great - thanks for your help and for bearing with my rusty C++! What 
> happens now? I'm waiting on this patch to land for another patch I submitted 
> a while ago: https://git.reviewboard.kde.org/r/130084/
> 
> Lamarque Souza wrote:
> Well, if you do not have a developer account I can commit the patch for 
> you. In order to do that I need your real name and email address to add them 
> to the commit's header.

Nope - I don't have a developer account. Real name is Konstantinos Tsanaktsidis 



- KJ


---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/130090/#review103148
---


On April 23, 2017, 9:56 a.m., KJ Tsanaktsidis wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/130090/
> ---
> 
> (Updated April 23, 2017, 9:56 a.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: solid
> 
> 
> Description
> ---
> 
> Previously, udesksblock.cpp was attempting to find a definition for
> major/minor on Linux in  by checking Q_OS_LINUX before
> importing the header. Q_OS_LINUX is however only set when
> qsystemdetection.h is included, and the macro was being checked first.
> 
> Even had this check worked, it would still be wrong. On a modern version
> of the userspace linux-headers,  includes definitions for
> major and minor that assume each is limited to 8 bits and that dev_t is
> 16 bits. This is no longer true anymore; on Linux, major numbers can be
> up to 12 bits at present and minor numbers up to 20. Calling these
> macros with dev_t values > 2^16 would give incorrect results.
> 
> Because the Q_OS_LINUX check failed, a fallback version of the macros
> were defined for use on all platforms. The code is allegedly copied from
> kdev_t.h, except it is copied from the *kernel* version of the header,
> not the userspace version. Linux internally uses a different
> representation of dev_t than it exposes to userspace - the kernelspace
> version is 20 bits of minor/12 bits of major contiguously, but the
> userspace version packs the bits in a different order to maintain
> compatability with old 16-bit device numbers. Thus, this code also does
> not work for dev_t values > 2^16.
> 
> To fix this, we add CMake rules to search for a system-provided
> definition of the major/minor macros - on various systems, these can be
> in a few different places. As a fallback, we assume old-style 16-bit
> dev_t (although I suspect that is only used for Windows, where
> major/minor numbers are pretty meaningless anyway).
> 
> 
> Diffs
> -
> 
>   autotests/CMakeLists.txt 54adeea62b954b9169b37f1eab8fa3e215fafafa 
>   autotests/fakeUdisks2.h PRE-CREATION 
>   autotests/fakeUdisks2.cpp PRE-CREATION 
>   autotests/solidudisks2test.cpp PRE-CREATION 
>   src/solid/devices/backends/udisks2/CMakeLists.txt 
> 34390064af29ace07cbb3470945be098cc606d04 
>   src/solid/devices/backends/udisks2/udisksblock.cpp 
> 0622ec77fcf670a2005d34b7a6c31ca8b53a18d8 
> 
> Diff: https://git.reviewboard.kde.org/r/130090/diff/
> 
> 
> Testing
> ---
> 
> I've written a little snippet to iterate through block devices, print their 
> major/minor number, and their device properties. It was previously 
> incorrectly labeling all my disks with major 0 and minor == device_number 
> (since it was using the first 20 bits for the minor). It now correctly 
> identifies their major/minor number.
> 
> 
> Thanks,
> 
> KJ Tsanaktsidis
> 
>