mirror of https://github.com/procxx/kepka.git
				
				
				
			Add a method to check if gtk integration is forced
This commit is contained in:
		
							parent
							
								
									368eeaf754
								
							
						
					
					
						commit
						47d7bd95ae
					
				| 
						 | 
					@ -263,6 +263,20 @@ bool IsStaticBinary() {
 | 
				
			||||||
#endif // !DESKTOP_APP_USE_PACKAGED
 | 
					#endif // !DESKTOP_APP_USE_PACKAGED
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool IsGtkIntegrationForced() {
 | 
				
			||||||
 | 
					#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
 | 
				
			||||||
 | 
						static const auto GtkIntegration = [&] {
 | 
				
			||||||
 | 
							const auto platformThemes = QString::fromUtf8(qgetenv("QT_QPA_PLATFORMTHEME")).split(':');
 | 
				
			||||||
 | 
							return platformThemes.contains(qstr("gtk3"), Qt::CaseInsensitive)
 | 
				
			||||||
 | 
								|| platformThemes.contains(qstr("gtk2"), Qt::CaseInsensitive);
 | 
				
			||||||
 | 
						}();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return GtkIntegration;
 | 
				
			||||||
 | 
					#endif // !TDESKTOP_DISABLE_GTK_INTEGRATION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return false;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool IsGtkFileDialogForced() {
 | 
					bool IsGtkFileDialogForced() {
 | 
				
			||||||
#ifdef TDESKTOP_FORCE_GTK_FILE_DIALOG
 | 
					#ifdef TDESKTOP_FORCE_GTK_FILE_DIALOG
 | 
				
			||||||
	return true;
 | 
						return true;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,6 +24,7 @@ bool InSandbox();
 | 
				
			||||||
bool InSnap();
 | 
					bool InSnap();
 | 
				
			||||||
bool InAppImage();
 | 
					bool InAppImage();
 | 
				
			||||||
bool IsStaticBinary();
 | 
					bool IsStaticBinary();
 | 
				
			||||||
 | 
					bool IsGtkIntegrationForced();
 | 
				
			||||||
bool IsGtkFileDialogForced();
 | 
					bool IsGtkFileDialogForced();
 | 
				
			||||||
bool IsQtPluginsBundled();
 | 
					bool IsQtPluginsBundled();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue