1
0
Fork 0

Remove unneeded imports, making compile 1.1x faster and making startup 2.7x faster

This commit is contained in:
namedkitten 2020-04-25 00:21:55 +01:00
parent f5679cc66e
commit 290be3df35
28 changed files with 25 additions and 145 deletions

View file

@ -1,10 +1,6 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
Item {

View file

@ -2,8 +2,6 @@ import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
Dialog {

View file

@ -1,6 +1,4 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import Qt.labs.settings 1.0
import player 1.0
Action {

View file

@ -1,7 +1,4 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import Qt.labs.settings 1.0
import player 1.0
Rectangle {
id: chapterMarker

View file

@ -1,6 +1,5 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import Qt.labs.settings 1.0
MenuItem {
id: menuItem

View file

@ -1,9 +1,3 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
Process {

View file

@ -1,9 +1,3 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
Process {

View file

@ -1,6 +1,4 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import Qt.labs.settings 1.0
import player 1.0
Action {

View file

@ -1,8 +1,6 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0

View file

@ -1,10 +1,6 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
Item {

View file

@ -1,10 +1,3 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
SmoothButton {

View file

@ -1,10 +1,3 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
SmoothButton {

View file

@ -1,15 +1,5 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
SmoothButton {
iconSource: "icons/" + appearance.themeName + "/fullscreen.svg"
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
onClicked: {
toggleFullscreen()
}

View file

@ -1,7 +1,5 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
Item {

View file

@ -1,10 +1,4 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
SmoothButton {

View file

@ -1,10 +1,3 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
SmoothButton {

View file

@ -1,10 +1,4 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
SmoothButton {

View file

@ -1,19 +1,21 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
SmoothButton {
id: settingsButton
iconSource: "icons/" + appearance.themeName + "/settings.svg"
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
onClicked: {
var aptn = appearance.themeName
appearance.themeName = aptn == "YouTube" ? "RoosterTeeth" : aptn
== "RoosterTeeth" ? "Niconico" : "YouTube"
switch(appearance.themeName) {
case "YouTube":
appearance.themeName = "RoosterTeeth"
break
case "RoosterTeeth":
appearance.themeName = "Niconico"
break
case "Niconico":
appearance.themeName = "YouTube"
break
default:
appearance.themeName = "YouTube"
}
}
}

View file

@ -1,13 +1,7 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import QtGraphicalEffects 1.0
import QtQuick 2.0
Control {
id: root
hoverEnabled: true

View file

@ -1,10 +1,5 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
Text {

View file

@ -1,15 +1,8 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
Text {
id: timeLabel
objectName: "timeLabel"
text: "0:00 / 0:00"
color: "white"
font.family: appearance.fontName

View file

@ -1,10 +1,5 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
Rectangle {

View file

@ -1,10 +1,5 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
Slider {
@ -40,7 +35,7 @@ Slider {
onPlayStatusChanged: function (status) {
if (status == Enums.PlayStatus.Playing) {
progressBar.playing = true
} else if (status == status == Enums.PlayStatus.Paused) {
} else if (status == Enums.PlayStatus.Paused) {
progressBar.playing = false
}
}

View file

@ -1,10 +1,4 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
SmoothButton {

View file

@ -1,11 +1,5 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
Slider {
id: volumeBar

View file

@ -1,6 +1,4 @@
import QtQuick 2.0
import Qt.labs.settings 1.0
import "translations.js" as Translations
Item {

View file

@ -1,14 +1,9 @@
import QtQuick 2.0
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import Qt.labs.settings 1.0
import Qt.labs.platform 1.0 as LabsPlatform
import player 1.0
import "codes.js" as LanguageCodes
Window {
id: mainWindow
title: "KittehPlayer"
@ -30,13 +25,14 @@ Window {
}
function getAppearanceValueForTheme(themeName, name) {
if (themeName == "YouTube") {
switch(themeName) {
case"YouTube":
return youTubeAppearance[name]
} else if (themeName == "Niconico") {
case "Niconico":
return nicoNicoAppearance[name]
} else if (themeName == "RoosterTeeth") {
case "RoosterTeeth":
return roosterTeethAppearance[name]
} else {
default:
appearance.themeName = "YouTube"
return youTubeAppearance[name]
}

1
version Normal file
View file

@ -0,0 +1 @@
1