Tidy up some code.
This commit is contained in:
parent
4582c8600c
commit
2f6f55c2bb
|
@ -16,7 +16,7 @@ before_install:
|
|||
- sudo apt-get update
|
||||
|
||||
install:
|
||||
- sudo apt-get -y install ccache build-essential git qt512-meta-minimal qt512quickcontrols qt512quickcontrols2 qt512svg qt512x11extras qt512graphicaleffects qt512svg libgl1-mesa-dev libmpv-dev libgl1-mesa-dev x11proto-xext-dev libx11-dev python3-setuptools
|
||||
- sudo apt-get -y install build-essential git qt512-meta-minimal qt512quickcontrols qt512quickcontrols2 qt512svg qt512x11extras qt512graphicaleffects qt512svg libgl1-mesa-dev libmpv-dev libgl1-mesa-dev x11proto-xext-dev libx11-dev python3-setuptools
|
||||
- sudo apt-get build-dep mpv
|
||||
- source /opt/qt*/bin/qt*-env.sh
|
||||
|
||||
|
|
|
@ -69,12 +69,6 @@ set(SOURCES
|
|||
${SOURCES}
|
||||
)
|
||||
|
||||
find_program(CCACHE_FOUND cache)
|
||||
if(CCACHE_FOUND)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||
endif(CCACHE_FOUND)
|
||||
|
||||
set(CMAKE_BUILD_TYPE DEBUG)
|
||||
|
||||
option(DEBUG "debugging out" OFF)
|
||||
|
|
|
@ -151,7 +151,7 @@ MPVBackend::MPVBackend(QQuickItem* parent)
|
|||
QSettings settings;
|
||||
usedirect = settings.value("Backend/direct", false).toBool();
|
||||
|
||||
mpv_set_option_string(mpv, "terminal", "false");
|
||||
mpv_set_option_string(mpv, "terminal", "true");
|
||||
mpv_set_option_string(mpv, "msg-level", "all=v");
|
||||
|
||||
// Fix?
|
||||
|
|
|
@ -27,12 +27,17 @@ initLogger(std::string name)
|
|||
QString logFile = settings.value("Logging/logFile", "/tmp/KittehPlayer.log").toString();
|
||||
|
||||
std::vector<spdlog::sink_ptr> sinks;
|
||||
|
||||
|
||||
sinks.push_back(std::make_shared<spdlog::sinks::stdout_color_sink_mt>());
|
||||
sinks.push_back(std::make_shared<spdlog::sinks::basic_file_sink_mt>(
|
||||
logFile.toUtf8().constData()));
|
||||
auto fileLogger = std::make_shared<spdlog::sinks::basic_file_sink_mt>(logFile.toUtf8().constData());
|
||||
fileLogger->set_level(spdlog::level::trace);
|
||||
sinks.push_back(fileLogger);
|
||||
auto console = std::make_shared<spdlog::logger>(name, begin(sinks), end(sinks));
|
||||
console->set_pattern("[%l][%n] %v%$");
|
||||
spdlog::register_logger(console);
|
||||
console->set_level(spdlog::level::debug);
|
||||
|
||||
|
||||
return spdlog::get(name);
|
||||
}
|
||||
|
|
|
@ -48,34 +48,28 @@ MenuBar {
|
|||
trackLang = trackLang == undefined ? "" : trackLang
|
||||
var trackTitle = track["title"] == undefined ? "" : track["title"] + " "
|
||||
var component = Qt.createComponent("TrackItem.qml")
|
||||
var menu, menuGroup, itemText, type;
|
||||
if (trackType == "sub") {
|
||||
var action = component.createObject(subMenu, {
|
||||
"text": trackLang,
|
||||
"trackID": String(trackID),
|
||||
"trackType": "sid",
|
||||
"checked": track["selected"]
|
||||
})
|
||||
action.ActionGroup.group = subMenuGroup
|
||||
subMenu.addAction(action)
|
||||
menu = subMenu;
|
||||
menuGroup = subMenuGroup;
|
||||
itemText = trackLang;
|
||||
} else if (trackType == "audio") {
|
||||
var action = component.createObject(audioMenu, {
|
||||
"text": trackTitle + trackLang,
|
||||
"trackID": String(trackID),
|
||||
"trackType": "aid",
|
||||
"checked": track["selected"]
|
||||
})
|
||||
action.ActionGroup.group = audioMenuGroup
|
||||
audioMenu.addAction(action)
|
||||
menu = audioMenu;
|
||||
menuGroup = audioMenuGroup;
|
||||
itemText = trackTitle + trackLang;
|
||||
} else if (trackType == "video") {
|
||||
var action = component.createObject(videoMenu, {
|
||||
"text": "Video " + trackID + trackTitle,
|
||||
"trackID": String(trackID),
|
||||
"trackType": "vid",
|
||||
"checked": track["selected"]
|
||||
})
|
||||
action.ActionGroup.group = videoMenuGroup
|
||||
videoMenu.addAction(action)
|
||||
menu = videoMenu;
|
||||
menuGroup = videoMenuGroup;
|
||||
itemText = "Video " + trackID + trackTitle;
|
||||
}
|
||||
var action = component.createObject(menu, {
|
||||
"text": itemText,
|
||||
"trackID": String(trackID),
|
||||
"trackType": trackType == "sub" ? "sid" : trackType == "video" ? "vid" : "aid",
|
||||
"checked": track["selected"]
|
||||
})
|
||||
action.ActionGroup.group = menuGroup
|
||||
videoMenu.addAction(action)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -330,9 +324,11 @@ MenuBar {
|
|||
audioDeviceMenu.addAction(action)
|
||||
}
|
||||
}
|
||||
|
||||
ActionGroup {
|
||||
id: audioDeviceMenuGroup
|
||||
ScrollView {
|
||||
clip: true
|
||||
ActionGroup {
|
||||
id: audioDeviceMenuGroup
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue