mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 08:00:05 +00:00 
			
		
		
		
	Fill in default path when no path is given for theme file
This commit is contained in:
		
							parent
							
								
									6afcf1312f
								
							
						
					
					
						commit
						15f906ad5a
					
				
					 1 changed files with 13 additions and 2 deletions
				
			
		|  | @ -45,6 +45,7 @@ | ||||||
| #include <QGeoPositionInfo> | #include <QGeoPositionInfo> | ||||||
| #include <QPushButton> | #include <QPushButton> | ||||||
| #include <QStandardItemModel> | #include <QStandardItemModel> | ||||||
|  | #include <QStandardPaths> | ||||||
| #include <QToolButton> | #include <QToolButton> | ||||||
| #include <utility> | #include <utility> | ||||||
| 
 | 
 | ||||||
|  | @ -585,8 +586,18 @@ void SettingsDialogImpl::SetupGeneralTab() | ||||||
|       { |       { | ||||||
|          const settings::GeneralSettings& generalSettings = |          const settings::GeneralSettings& generalSettings = | ||||||
|             settings::GeneralSettings::Instance(); |             settings::GeneralSettings::Instance(); | ||||||
|          const QString file = |          QString file = generalSettings.theme_file().GetStagedOrValue().c_str(); | ||||||
|             generalSettings.theme_file().GetStagedOrValue().c_str(); | 
 | ||||||
|  |          if (file.isEmpty()) | ||||||
|  |          { | ||||||
|  |             const QString appDataPath {QStandardPaths::writableLocation( | ||||||
|  |                QStandardPaths::AppLocalDataLocation)}; | ||||||
|  |             file = appDataPath + "/theme.conf"; | ||||||
|  |             self_->ui->themeFileLineEdit->setText(file); | ||||||
|  |             // setText does not emit the textEdited signal
 | ||||||
|  |             Q_EMIT self_->ui->themeFileLineEdit->textEdited(file); | ||||||
|  |          } | ||||||
|  | 
 | ||||||
|          const QPalette palette = |          const QPalette palette = | ||||||
|             Qt6CT::loadColorScheme(file, QApplication::palette()); |             Qt6CT::loadColorScheme(file, QApplication::palette()); | ||||||
|          QStyle* style = QApplication::style(); |          QStyle* style = QApplication::style(); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak