Skip to content

Initial port to Qt5 and KF5#3

Open
marcpayne wants to merge 8 commits intogtgt:masterfrom
marcpayne:qt5-kf5-port
Open

Initial port to Qt5 and KF5#3
marcpayne wants to merge 8 commits intogtgt:masterfrom
marcpayne:qt5-kf5-port

Conversation

@marcpayne
Copy link
Copy Markdown

This is a work-in-progress port to Qt5 and KF5 that I have been working on, in part to learn more about programming with Qt. The major changes are in main.cpp and the CMakeLists.txt files. I followed the KDE Frameworks Porting Notes, along with a few other sources.

I decided to focus on cmake rather than qmake, since cmake is used extensively in KDE. This required moving locale files and some icons to different locations to ease installation (which accounts for the bulk of the diffs below). I kept the original directory layout intact.

Aside from main.cpp, most of the changes to the code are minor. I can say that kfilebox compiles and executes perfectly for me, and it runs nicely in the tray. Translations are sketchy, however. I think that the .ui files aren't getting processed correctly by cmake.

You will find more detailed explanations in my commit messages. There is more to do to finish the port, but this is a decent starting point. TBH, I am not sure if my work has much value, since Dropbox is based on Qt now and it has very limited interfaces for external apps like kfilebox. Nevertheless, there are still plenty of users, so an update might be welcome!

Thanks for your consideration!

This is a work-in-progress, but most of the necessary pieces are in place. Here
is a brief summary of the changes:

- Detect the required Qt5/KF5 dependencies
- Let cmake take care of moc, uic, and qrc files
- Install files to standard locations

Note that we explicitly require Qt5/KF5 components, so there is no backwards
compatibility with earlier versions.

To build kfilebox using cmake (rather than qmake) please do the following:

$ mkdir build
$ cd build
$ cmake [options] ..
$ make
I have to thank the Kate team, as most of the work done here was based on their
very well-documented code. The bulk of the porting effort lies in main, and my
work was made much simpler due to their code. Thank you!

Primary changes:

- Switch from KUniqueApplication to QApplication
- Use KLocalizedString for i18n
- Use QCommandLineParser to provide nice default cmdline options
Not much to be said here. The diffs should be self-explanatory.
Dropbox has changed a lot over the years. We cannot get a list of recently
changed files as we used to. If someone is able to decrypt config.dbx, we might
get somewhere, although Dropbox would not be very happy about it.
To ease installation of hicolor icons to the standard locations, move them to
icons/ and let cmake do the work (extra-cmake-modules required). Only the
application icons have been moved. The tray status icons are hard-coded and
compiled into the binary, so they are left in img/.
It seems to be a common convention to place all po files into a po/ directory
and name them <lang>.po. Doing so greatly simplifies installation for me, and
hopefully for packagers.

One *extremely* important note: while the files seem to be correctly processed
into mo files, I was not able to get translations to work in my testing. For
example, setting LANG="de" translates none of the strings in kfilebox. Even the
previously generated mo files do not work for me.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant