An easy demo for open a mime-type file with application-lauch-configration, mainly depends on gio (g_app_info_*). Just like we open a file in the filemanager, this program intents to use very few codes to simply reproduce the whole workflow. Use FileDialog to choose a file, and use ListView to choose the application for openning, and then use a Dialog to determine if you need to set this app as the default app to open the type file.
BTW, in Qt, we can use QDesktopService::openUrl() to open a file with it's default application. But it seems that at this time there is no API to set the defaut application in Qt.
- qt5-default
- gilb-2.0
- gio-2.0
- qmake
- git clone and cd into the code directory
- mkdir build && cd build
- qmake ..
- ./app-launch-demo
- qt-creator
- make sure your qt-creator work
- import the .pro file
- run