Fix Default Applications panel

This commit is contained in:
Victor Tran 2021-04-26 15:20:11 +10:00
parent dcc57fdf40
commit 3c0fcf870c
No known key found for this signature in database
GPG key ID: 1F0729FE016CDC3E
6 changed files with 18 additions and 9 deletions

View file

@ -138,7 +138,7 @@ unix {
media.path = /usr/share/thedesk/
acknowledgements.files = acknowledgements.html
acknowledgements.path = /usr/share/thedesk/acknowledgements.html
acknowledgements.path = /usr/share/thedesk
INSTALLS += target translations defaults media acknowledgements
}

View file

@ -30,7 +30,7 @@ Acknowledgements::Acknowledgements(QWidget* parent) :
ui->setupUi(this);
ui->titleLabel->setBackButtonShown(true);
ui->textBrowser->setSource(QUrl::fromLocalFile(QStringLiteral("/home/victor/Documents/Apps/thedesk/desktop/acknowledgements.html")), QTextDocument::HtmlResource);
ui->textBrowser->setSource(QUrl::fromLocalFile(QStringLiteral("/usr/share/thedesk/acknowledgements.html")), QTextDocument::HtmlResource);
}
Acknowledgements::~Acknowledgements() {

View file

@ -19,6 +19,7 @@
* *************************************/
#include "cursorhandler.h"
#include <tlogger.h>
#include <tsettings.h>
#include <QLibrary>
@ -51,7 +52,7 @@ void CursorHandler::updateApplicationCursor() {
#ifdef HAVE_X11
if (QX11Info::isPlatformX11()) {
//Load cursor library
QLibrary xc(QString(SYSTEM_LIBRARY_DIRECTORY).append("/libXcursor"));
QLibrary xc(QString(SYSTEM_LIBRARY_DIRECTORY).append("/libXcursor.so"));
if (xc.load()) {
typedef int (*setThemeFunc) (Display*, const char*);
@ -63,6 +64,8 @@ void CursorHandler::updateApplicationCursor() {
//Set cursors
XcursorSetTheme(QX11Info::display(), qPrintable(d->settings->value("Platform/cursor").toString()));
XcursorSetDefaultSize(QX11Info::display(), d->settings->value("Platform/cursorSize").toInt());
} else {
tDebug("CursorHandler") << "Could not load XCursor library: " + xc.errorString();
}
}
#endif

View file

@ -8,7 +8,11 @@ CONFIG += c++11
unix {
# Include the-libs build tools
include(/usr/share/the-libs/pri/gentranslations.pri)
equals(THELIBS_BUILDTOOLS_PATH, "") {
THELIBS_BUILDTOOLS_PATH = $$[QT_INSTALL_PREFIX]/share/the-libs/pri
}
include($$THELIBS_BUILDTOOLS_PATH/gentranslations.pri)
include($$THELIBS_BUILDTOOLS_PATH/varset.pri)
CONFIG += link_pkgconfig
@ -73,7 +77,7 @@ unix {
INSTALLS += target translations defaults
}
DEFINES += SYSTEM_LIBRARY_DIRECTORY=\\\"$$THELIBS_INSTALL_LIB\\\"
DEFINES += SYSTEM_LIBRARY_DIRECTORY=\\\"$$[QT_INSTALL_LIBS]\\\"
RESOURCES += \
thedesk-platform-resources.qrc

View file

@ -28,6 +28,8 @@ Common::DevicePort Common::portForSink(PulseAudioQt::Sink* sink) {
if (api == QStringLiteral("bluez")) {
return Bluetooth;
} else {
if (sink->ports().count() <= sink->activePortIndex()) return Unknown;
PulseAudioQt::Port* port = sink->ports().at(sink->activePortIndex());
if (port->availability() == PulseAudioQt::Port::Unavailable) {
//Weird thing? Use a workaround here
@ -62,9 +64,9 @@ QString Common::nameForSink(PulseAudioQt::Sink* sink) {
QVariantMap properties = sink->properties();
QString api = properties.value("device.api").toString();
if (api == QStringLiteral("alsa")) {
return sink->properties().value("device.product.name").toString();
return properties.value("device.product.name", properties.value("node.nick")).toString();
} else if (api == QStringLiteral("bluez")) {
return sink->properties().value("bluez.alias").toString();
return properties.value("bluez.alias").toString();
} else {
return sink->description();
}

View file

@ -62,8 +62,8 @@ void DefaultsPane::loadDefaults() {
ApplicationPointer app = MimeAssociationManager::defaultApplicationForMimeType(mimeType);
if (app) {
for (int i = 0; i < ui->defaultBrowserBox->count(); i++) {
if (box->itemData(i).toString() == app->desktopEntry()) ui->defaultBrowserBox->setCurrentIndex(i);
for (int i = 0; i < box->count(); i++) {
if (box->itemData(i).toString() == app->desktopEntry()) box->setCurrentIndex(i);
}
}
}