I have been looking into extending the coordinate-based timezone lookup system we have in KItinerary, in order to ready it for being moved to KDE Frameworks. The first step however is finding suitable boundary data files for this, next to the timezone ones.
The existing code uses the IANA timezone boundaries to implement not only timezone lookup but also an almost complete country lookup. There’s however limitations with this, and there’s use cases for which an even higher level of detail would be desirable:
Asia/Bangkok
also being used in northern Vietnam.So, ideally we’d want a coordinate lookup not only for the timezone but also the country subdivision (ISO 3166-2), the country (ISO 3166-1) follows from that reliably in all cases then.
The Z-order curve used by the existing timezone lookup code is generated by a QGIS script and needs either a Shapefile or a GeoJSON file with the boundary polygons as input.
We’d also want something that matches the resolution of the timezone boundaries as closely as possible. This isn’t so much about the high level of precision, we need to considerably reduce that for efficient storage anyway, but about avoiding artifacts along the borders caused by different levels of detail. And it goes without saying that we also need this as proper Open Data under a suitable license.
Unfortunately with those requirements it gets hard to find ready-made datasets for this, so DIY to the rescue!
We don’t have to start from scratch, we can look at the timezone boundary builder as a starting point. Our problem is even considerably easier, as we don’t have to puzzle together our polygons from various pieces of OSM data, we just need to extract the right boundaries from OSM.
Its approach of using Overpass for retrieving the needed data unfortunately didn’t work reliably for me, repeatedly resulting in timeouts and throttling. So I ended up with working with a full offline OSM copy again instead.
The code for this is here. It generates Shapefile and GeoJSON of both ISO 3166-1 and ISO 3166-2 boundaries from OSM data and performs a few sanity checks on it.
You can find the current versions of the generated data here, the same license as for OSM data applies:
While the country boundaries looks reasonably complete and correct, you can spot a few issues in the subdivision data. This can for example have one of the following reasons:
Fixing those issues upstream in the OSM data would be by far the easiest way to complete the boundary data extracts. This is probably best done by people on the ground in the respective countries though, messing with a sensitive subject like land borders from halfway around the world doesn’t seem like a good idea. The good news however is that a lot of issues found just two weeks ago are already fixed.
Even if not perfect yet, this gives us enough data to continue exploring efficient coordinate-based lookup. While I’m quite sure the Z-order curve approach will technically hold up, I’m not sure how well it scales with the ten-fold increase in different areas. We still want to keep the result small enough for shipping in mobile apps after all.
There are just a few days left before Plasma 5.21 is released, so get ready! And check out all this cool stuff too. Train doesn’t stop!
Kate’s project plugin now offers you the ability to switch git branches right there in the main UI (Waqar Ahmed, Kate 21.04):
Plasma’s Audio Volume applet now offers you the opportunity to change a device’s audio profile right there in the applet, without having to go elsewhere (Kai Use Broulik, Plasma 5.22):
Kate no longer sometimes creates a new document when closing tabs with a middle-click (Jan Paul Batrina,c Kate 21.04)
Dolphin no longer crashes when viewing large folders in Tree view (Felix Ernst, Dolphin 21.04)
QML-based apps that override the theme no longer crash when that theme is Breeze (David Redondo, Plasma 5.21)
Neither Plasma nor the whole session will crash when dragging a file over a Task Manager entry in the Plasma Wayland session (David Edmundson, Plasma 5.21)
Fixed a bug that could cause widgets to sometimes be irremovable from a panel (Niccolò Venerandi, Plasma 5.21)
Non-Task-Manager panel applets once again respect Fitts’ law regarding their click targets (Niccolò Venerandi, Plasma 5.21)
The buttons in Plasma’s “new screen connected” OSD once again work (David Redondo, Plasma 5.21)
KRunner’s Locations runner now works again (Alexander Lohnau, Plasma 5.21)
Plasma no longer sometimes crashes when deleting an activity (Willyanto, Plasma 5.21)
Disk monitoring widgets now show the correct information for current throughput and no longer display “Total Uploaded” when they should be displaying “Upload Rate” (David Redondo, Plasma 5.21)
Discover is now substantially faster to launch (Aleix Pol Gonzalez, Plasma 5.21)
Fedora’s Anaconda installer now works in the Plasma Wayland session (Vlad Zahorodnii, Plasma 5.21)
Discover no longer sometimes shows bogus extra sources in its “Sources” menu when viewing the details page for a Flatpak app (Aleix Pol Gonzalez, Plasma 5.21)
KWin now detects hot-plugged VR headsets (Xaver Hugl, Plasma 5.21)
Reducing the screen brightness to the lowest level such that it turns off the backlight no longer causes the backlight to flicker back on for a moment before turning off again (Kai Uwe Broulik, Plasma 5.21)
Scrollbars in Breeze-GTK-themed GTK apps no longer display stepper arrows when they shouldn’t (Jan Blackquill, Plasma 5.21)
Discover’s “Write a review” sheet is no longer almost unusably narrow (me: Nate Graham, Plasma 5.21.1)
It’s now possible to immediately apply newly-downloaded wallpapers whose names include a space (Dan Leinir Turthra Jensen, Frameworks 5.79)
When comparing two files in the move/copy overwrite dialog, size differences larger than 2 GiB are no longer erroneously described as being 16 EiB (!!!) (Méven Car, Frameworks 5.80)
Konsole no longer crashes when searching for new appearance settings using the Get New [thing] dialog (Alexander Lohnau, Frameworks 5.80)
Slightly improved the launch speed of all Kirigami-using apps (Arjen Hiemstra, Frameworks 5.80)
The few remaining settings pages that open in standalone windows now look good again (Ismael Asensio and me: Nate Graham, Frameworks 5.80):
Gwenview now allows you to change the quality/compression level for other lossy image formats, such as WEBP, AVIF, HEIF, and HEIC (me: Nate Graham, Gwenview 21.04)
Kate now enables by default the feature to cut or copy the current line when nothing is selected and you use the cut or copy action (Alexander Lohnau, Kate 21.04)
Resizing Dolphin’s window now re-arranges the icons using a single smooth animation, not a weird two-part animation (Felix Ernst, Dolphin 21.04)
Hitting the escape key while in Okular’s full-screen view now returns to the windowed view (Michael Augaitis, Okular 21.04)
The new Wayland-specific keyboard layout applet now has text that scales with the thickness of the panel it’s located on (Andrey Butirsky, Plasma 5.21)
System Settings’ Window Decorations page now uses the fancy shiny new QML-based Get New [thing] window instead of the old funky QWidgets one (Alexander Lohnau, Plasma 5.22)
System Settings’ Virtual Desktops page now supports the “Highlight changed settings” feature (Cyril Rossi, Plasma 5.22)
You can now configure the Disks & Devices applet to play a sound when a device can be safely removed (me: Nate Graham, Plasma 5.22)
Carl Schwan overhauled Kate’s website to use our fancy modern new theme:
Niccolò Venerandi published part two in his video series about how to create a plasma theme:
Leszek Lesner published a video about kio-fuse, which makes it easier to interact with remote files:
Have a look at https://community.kde.org/Get_Involved to discover ways to be part of a project that really matters. Each contributor makes a huge difference in KDE; you are not a number or a cog in a machine! You don’t have to already be a programmer, either. I wasn’t when I got started. Try it, you’ll like it! We don’t bite!
Finally, consider making a tax-deductible donation to the KDE e.V. foundation.
I figure if we can write about “first quarter” of the year, then “first octant” also makes sense. So here’s the first six weeks of KDE-on-FreeBSD-in-2021 in a daemon-approved nutshell.
The kde@ team is a half-dozen people or so, some of whom are committers, some channel updates through Tobias or myself. The things I describe below are not my work, but our collective efforts over an octant.
The kde@ team maintains a bunch of software that isn’t from the KDE community; sometimes it’s Qt-based, sometimes it is build-infrastructure, and sometimes it is just cool stuff.
It’s not just the packaging of individual libraries or applications, but also the maintainence of the infrastructure that builds the packages; that’s the FreeBSD ports system and sometimes we work on that, too (usually it is in other capable hands).
KDE_INVENT
.
Setting this variable to a 40-character commit hash and a KDE Invent
category name will fetch from KDE’s GitLab instance. In general
we hope this is hardly used, since we ought to be packaging released
software (but, e.g. ruqola doesn’t have releases).
This is a convenience we hope we do not need to use much.Another day, another blog about some of KDAB’s utility classes. Now it’s the turn of KDSingleApplication, a class that helps implement applications that follow the single-instance policy.
Single-instance policy refers to those applications that want to spawn a unique instance for a given user session. Even when launched multiple times, such applications will not spawn a number of separate instances. Instead, the existing instance will be notified, somehow, and some action will be taken by that instance. Typically, its window will be shown (if hidden) and raised to the foreground.
This mechanism works even when the application is launched indirectly, like from a file manager when opening a file type associated with the application. In this case, the new instance (launched by the file manager) will simply tell the existing instance to open the selected file, and then the new instance will immediately quit.
The problem is: on most operating systems we do normally get a new instance every time we launch an application! Therefore, some logic is needed to honor a single-instance policy. KDSingleApplication implements such logic.
KDSingleApplication is a redesign of QtSingleApplication and other similar code that lives around in a few repositories.
The biggest advantage of KDSingleApplication over the old solutions is that it does not replace QCoreApplication/QGuiApplication/QApplication by inheriting from them. Such an inheritance is, generally speaking, a symptom of bad design. Unless we modify the solution’s own code, we cannot control which application class we’re using. Moreover, we cannot use the solution and another custom subclass of the application class. This is useful in some scenarios, because there can be only one application object!
KDSingleApplication instead complements your application object. You’re simply supposed to create an application object (of whatever kind is necessary) and then create a KDSingleApplication object:
int main(int argc, char **argv) { QApplication app(argc, argv); KDSingleApplication kdsa;
After that, we will need to check whether our instance is the main (“primary”) instance, or a “secondary” one. The idea is that primary instances can receive arbitrary messages from the secondary instances and act on them in application-specific ways (open a file, show and raise the application’s main window, and so on).
The check looks like this:
if (kdsa.isPrimaryInstance()) { /* primary: listen to messages */ QObject::connect(&kdsa, &KDSingleApplication::messageReceived, /* handle messages from the secondary instances */); } else { /* secondary: send message to the primary */ kdsa.sendMessage("some message to the primary"); /* quit */ return 0; }
The example shipped with KDSingleApplication illustrates the handling of messages in more detail.
You can download KDSingleApplication from its GitHub repository: https://github.com/KDAB/KDSingleApplication; it is distributed under the MIT license. Yes, for various practical reasons, KDSingleApplication lives in its own repository. Nonetheless, enjoy!
If you like this blog and want to read similar articles, consider subscribing via our RSS feed.
Subscribe to KDAB TV for similar informative short video content.
KDAB provides market leading software consulting and development services and training in Qt, C++ and 3D/OpenGL. Contact us.
The post KDSingleApplication: a class for single-instance policy applications appeared first on KDAB.
The Fiduciary License Agreement (FLA) for KDE is a document with a long history; it has served us across two, maybe three major Qt and KDE versions, across probably two changes in version control systems, and a host of changes in the world and the KDE community. This week I started to update the document for the current situation.
The FLA can be found on the KDE e.V. website on the forms page, with some background and a list of signatories as well.
On my blog, I wrote about the FLA in 2020 (here about the FLA and here about SPDX) and also in 2009 (here about licensing and here when it launched). I’ll repeat some of the background information today, then describe what is being updated.
The FLA is a mechanism for assigning copyright – generally copyright over a piece of software – to a fiduciary. Someone you trust. The fiduciary is expected to Do The Right Thing with the copyright that is assigned to it. Unlike a Copyright License Agreement (or Assignment) which some software projects use, the FLA is carefully constructed to keep everything Free Software and to circumscribe what the fiducary may do. In addition, the FLA ensures that you, the original copyright holder, can continue to do all the Free Software things that you could originally do with your software.
So what’s the point?
Well, unlike a CLA, the FLA was written with preserving-your-Software-Freedom in mind (the FSFE spearheaded this approach) so that you can continue to use your code and release it under whatever license you like, while the fiduciary can also do that, but in a restricted (preserving Freedom) fashion. This allows centralizing – to the fiduciary – some decisions about the software that may be needed in the longer term.
The FLA text is stored in a git repository so the full history of the document is right there. It’s written in English, but marked up in LaTeX which may be a bit daunting; I’m not going to bother changing the format, though, since textual changes are still obvious enough.
Here’s some trivial changes:
And here’s the important bits:
The new version is not yet on the KDE e.V. website; there are some administrative hurdles to be taken that will tide us over until Akademy.
People already have! Nicolás Alvarez has added CI so that PDFs are built from the LaTeX sources, and Kevin Ottens had some layout improvements.
Since the FLA text lives in KDE Invent, it is open to merge requests. I’m working on the text when I have time. There is one relevant branch: update-1.3.6 which is for all the current round of updates, and one associated issue (number 1). I’d be happy for people to chase down things like the URL for REUSE guidelines, fixing links to Techbase (which should be the community wiki now), highlighting places where kdelibs4 is described as the latest-and-greatest .. document maintainence is a lot like software maintainence in that regard, there is plenty of not-so-charming work to do.
Once the text is done, then the next hurdles are:
If you are a KDE contributor (of artwork, code or documentation) and have not signed it at all, feel free: but double-check the document and remember that it is optional.
This is a guest blog post by Felgo, an official Qt Technology and Service Partner.
Qt makes it easy to develop applications for Desktop, Mobile and Embedded platforms, all from a single code base. No other solution offers to build native cross-platform apps for all these platforms at once. But since the rise of mobile and smart devices in all kinds of shapes and sizes, bridging the gap between platforms has become even harder. By solving a lot of common problems in many real-life projects, Felgo built a variety of higher-level APIs and development tools on top of Qt that help you save time and worries. Read on to learn how to overcome these challenges from the development to the release.
Kdenlive 20.12.2, part of our monthly bugfix release, is now available and fixes several important issues. Among the changes:
The downloads are available as usual from our Download page.
Autocrypt support is now in Kontact! This has been several weeks of work. Autocrypt makes it easier for you to use encrypted messages, as is handles key transfer for you automatically.
There are several parts involved in supporting Autocrypt. First, Autocrypt uses Protected Headers, implemented already. Within Autocrypt I found some issues and fixed them. Than I began implementing the receiving of Autocrypt messages. The key concept of Autocrypt is to always send the public key within each email, so the receivers are always able to answer encrypted. The first step was extraction of the key and saving it to disk. Because Autocrypt sends keys unverified at the moment, I decided to not import the Autocrypt keys into the users' keyrings, but keep them separately in json files under ~/.local/share/autocrypt
.
After having all data of processed mails stored. I started to implement the sending part of Autocrypt. While implementing I learned that GnuPG does not like to handle two different keyrings anymore. I solved this by creating a temporary keyrings with all keys needed to encrypt a mail. This is certainly not perfect but works for now. There is room for improvement, of course. But as I needed to touch the code of KeyResolver I found out that contact preferences have been disabled for around 2 years, because back then Akonadi locked sometimes during search queries. I think this is not a problem anymore, so I will enable it again pim/messagelib!35. Hopefully with the feedback will ensure that it now just works, or we'll receive more informative failure reports that help to fix the issue.
For testing I used a mail address with an underscore and could reproduce #370385, and then made a journey into akonadi-search. It took a while before I understand the issue, because mail addresses in From or To header can be found correctly. In the end I found a fix: pim/akonadi-search!5. It would be helpful got get feedback from people who know Xapian to improve this code, because for me it feels like poking around in the dark.
Back from the journey, I needed to add Autocrypt support into identities, so you can now enable Autocrypt on an identity basis. I think the complete part is ready for enthusiasts to enable it. This as an experimental feature for now, and you need to enable it in the configuration file by hand. So if you ride the master branch you can enable it by setting Autocrypt = true
for each identity in ~/.config/emailidentities
. At the moment I cannot tell if this will be stable enough to show users the Autocrypt checkbox in the next release 21.04.
What is working so far?
I tried to implement it in a way that will not break existing workflows. If there is at least one valid key of an user in your keyring, this will be preferred and Autocrypt does not kicks in. A valid key is a key that is neither expired, nor revoked nor disabled and suitable for encryption. Only if no valid key is found, a valid key is searched within Autocrypt storage. This ensures that existing encrypted communication is as safe as before.
What is missing?
I hope you enjoy Autocrypt support in Kontact. The next steps are to finish the missing parts and refactor the crypto support in Kontact. This work I do is supported by funding from nlnet to improve mail encryption.