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 2.0
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2 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 player 1.0
Item { Item {

View file

@ -2,8 +2,6 @@ import QtQuick 2.0
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Window 2.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 player 1.0
Dialog { Dialog {

View file

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

View file

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

View file

@ -1,6 +1,5 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import Qt.labs.settings 1.0
MenuItem { MenuItem {
id: 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 import player 1.0
Process { 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 import player 1.0
Process { Process {

View file

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

View file

@ -1,8 +1,6 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.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 Qt.labs.platform 1.0 as LabsPlatform
import player 1.0 import player 1.0

View file

@ -1,10 +1,6 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2 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 player 1.0
Item { 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 import player 1.0
SmoothButton { 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 import player 1.0
SmoothButton { 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 { SmoothButton {
iconSource: "icons/" + appearance.themeName + "/fullscreen.svg" iconSource: "icons/" + appearance.themeName + "/fullscreen.svg"
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
onClicked: { onClicked: {
toggleFullscreen() toggleFullscreen()
} }

View file

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

View file

@ -1,10 +1,4 @@
import QtQuick 2.0 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 player 1.0
SmoothButton { 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 import player 1.0
SmoothButton { SmoothButton {

View file

@ -1,10 +1,4 @@
import QtQuick 2.0 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 player 1.0
SmoothButton { 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 import player 1.0
SmoothButton { SmoothButton {
id: settingsButton id: settingsButton
iconSource: "icons/" + appearance.themeName + "/settings.svg" iconSource: "icons/" + appearance.themeName + "/settings.svg"
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
onClicked: { onClicked: {
var aptn = appearance.themeName switch(appearance.themeName) {
appearance.themeName = aptn == "YouTube" ? "RoosterTeeth" : aptn case "YouTube":
== "RoosterTeeth" ? "Niconico" : "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 2.0
import QtQuick.Controls 2.3 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 QtGraphicalEffects 1.0
import QtQuick 2.0
Control { Control {
id: root id: root
hoverEnabled: true hoverEnabled: true

View file

@ -1,10 +1,5 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.3 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 player 1.0
Text { Text {

View file

@ -1,15 +1,8 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.3 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 { Text {
id: timeLabel id: timeLabel
objectName: "timeLabel"
text: "0:00 / 0:00" text: "0:00 / 0:00"
color: "white" color: "white"
font.family: appearance.fontName font.family: appearance.fontName

View file

@ -1,10 +1,5 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.3 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 player 1.0
Rectangle { Rectangle {

View file

@ -1,10 +1,5 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.3 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 player 1.0
Slider { Slider {
@ -40,7 +35,7 @@ Slider {
onPlayStatusChanged: function (status) { onPlayStatusChanged: function (status) {
if (status == Enums.PlayStatus.Playing) { if (status == Enums.PlayStatus.Playing) {
progressBar.playing = true progressBar.playing = true
} else if (status == status == Enums.PlayStatus.Paused) { } else if (status == Enums.PlayStatus.Paused) {
progressBar.playing = false progressBar.playing = false
} }
} }

View file

@ -1,10 +1,4 @@
import QtQuick 2.0 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 player 1.0
SmoothButton { SmoothButton {

View file

@ -1,11 +1,5 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.3 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 { Slider {
id: volumeBar id: volumeBar

View file

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

View file

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

1
version Normal file
View file

@ -0,0 +1 @@
1