Add framework to blacklist apps from using kgtk-qt3

The only application currently on the blacklist is Audacity
Bugs affected: 516


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kgtk-qt3@1258111 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent d48bdbc94b
commit b3052913e3

@ -94,7 +94,8 @@ typedef enum
APP_GIMP,
APP_INKSCAPE,
APP_FIREFOX,
APP_KINO
APP_KINO,
APP_BLACKLISTED
} Application;
static const char *kgtkAppName=NULL;
@ -508,6 +509,15 @@ static void determineAppName()
printf("KGTK::Firefox\n");
#endif
}
//===========================================================================
// BLACKLISTED APPS FOLLOW
// These applications crash regularly under kgtk-qt3 for unknown reasons,
// although bad programming within the blacklisted application is a good bet!
//===========================================================================
else if(isApp(prg, "audacity"))
{
kgtkApp=APP_BLACKLISTED;
}
else
{
kgtkApp=APP_UNKNOWN;
@ -533,7 +543,7 @@ static gboolean kgtkInit(const char *appName)
if(useKde)
{
determineAppName();
if ((kgtkApp != APP_UNKNOWN) || (!BLACKLIST_UNKNOWN_GTK_APPS)) {
if (((kgtkApp != APP_UNKNOWN) || (!BLACKLIST_UNKNOWN_GTK_APPS)) && (kgtkApp != APP_BLACKLISTED)) {
if(!g_threads_got_initialized)
g_thread_init(NULL);
atexit(&kgtkExit);
@ -542,10 +552,10 @@ static gboolean kgtkInit(const char *appName)
}
#ifdef KGTK_DEBUG
printf("KGTK::kgtkInit useKde:%d\n", (useKde && ((kgtkApp != APP_UNKNOWN) || (!BLACKLIST_UNKNOWN_GTK_APPS))));
printf("KGTK::kgtkInit useKde:%d\n", (useKde && (((kgtkApp != APP_UNKNOWN) || (!BLACKLIST_UNKNOWN_GTK_APPS))) && (kgtkApp != APP_BLACKLISTED)));
#endif
return (useKde && ((kgtkApp != APP_UNKNOWN) || (!BLACKLIST_UNKNOWN_GTK_APPS)));
return (useKde && (((kgtkApp != APP_UNKNOWN) || (!BLACKLIST_UNKNOWN_GTK_APPS)) && (kgtkApp != APP_BLACKLISTED)));
}
/* ......................... */
@ -1158,7 +1168,7 @@ void gtk_widget_hide(GtkWidget *widget)
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_widget_hide");
determineAppName();
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
#ifdef KGTK_DEBUG
printf("KGTK::gtk_widget_hide Bypassing internal function\n\r"); fflush(stdout);
#endif
@ -1268,7 +1278,7 @@ gint gtk_dialog_run(GtkDialog *dialog)
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_dialog_run");
determineAppName();
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
#ifdef KGTK_DEBUG
printf("KGTK::gtk_dialog_run Bypassing internal function\n\r"); fflush(stdout);
#endif
@ -1491,7 +1501,7 @@ gchar * gtk_file_chooser_get_filename(GtkFileChooser *chooser)
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_file_chooser_get_filename");
determineAppName();
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
#ifdef KGTK_DEBUG
printf("KGTK::gtk_file_chooser_get_filename Bypassing internal function\n\r"); fflush(stdout);
#endif
@ -1513,7 +1523,7 @@ gboolean gtk_file_chooser_select_filename(GtkFileChooser *chooser, const char *f
if(!realFunction)
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_file_chooser_select_filename");
realFunction(chooser, filename);
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
return;
}
@ -1554,7 +1564,7 @@ void gtk_file_chooser_unselect_all(GtkFileChooser *chooser)
if(!realFunction)
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_file_chooser_unselect_all");
realFunction(chooser);
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
return;
}
@ -1577,7 +1587,7 @@ gboolean gtk_file_chooser_set_filename(GtkFileChooser *chooser, const char *file
if(!realFunction)
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_file_chooser_set_filename");
realFunction(chooser, filename);
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
return;
}
@ -1618,7 +1628,7 @@ void gtk_file_chooser_set_current_name(GtkFileChooser *chooser, const char *file
GtkFileChooserAction act=gtk_file_chooser_get_action(chooser);
if ((GTK_FILE_CHOOSER_ACTION_SAVE==act || GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER==act) ||
((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS)
(((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED))
)
{
static void * (*realFunction)() = NULL;
@ -1626,7 +1636,7 @@ void gtk_file_chooser_set_current_name(GtkFileChooser *chooser, const char *file
if(!realFunction)
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_file_chooser_set_current_name");
realFunction(chooser, filename);
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
return;
}
}
@ -1654,7 +1664,7 @@ GSList * gtk_file_chooser_get_filenames(GtkFileChooser *chooser)
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_file_chooser_get_filenames");
determineAppName();
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
#ifdef KGTK_DEBUG
printf("KGTK::gtk_file_chooser_get_filenames Bypassing internal function\n\r"); fflush(stdout);
#endif
@ -1691,7 +1701,7 @@ gboolean gtk_file_chooser_set_current_folder(GtkFileChooser *chooser, const gcha
if(!realFunction)
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_file_chooser_set_current_folder");
realFunction(chooser, folder);
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
return;
}
@ -1720,7 +1730,7 @@ gchar * gtk_file_chooser_get_current_folder(GtkFileChooser *chooser)
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_file_chooser_get_current_folder");
determineAppName();
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
#ifdef KGTK_DEBUG
printf("KGTK::gtk_file_chooser_get_current_folder Bypassing internal function\n\r"); fflush(stdout);
#endif
@ -1748,7 +1758,7 @@ gchar * gtk_file_chooser_get_uri(GtkFileChooser *chooser)
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_file_chooser_get_uri");
determineAppName();
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
#ifdef KGTK_DEBUG
printf("KGTK::gtk_file_chooser_get_uri Bypassing internal function\n\r"); fflush(stdout);
#endif
@ -1779,7 +1789,7 @@ gboolean gtk_file_chooser_set_uri(GtkFileChooser *chooser, const char *uri)
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_file_chooser_set_uri");
determineAppName();
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
#ifdef KGTK_DEBUG
printf("KGTK::gtk_file_chooser_set_uri Bypassing internal function\n\r"); fflush(stdout);
#endif
@ -1810,7 +1820,7 @@ GSList * gtk_file_chooser_get_uris(GtkFileChooser *chooser)
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_file_chooser_get_uris");
determineAppName();
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
#ifdef KGTK_DEBUG
printf("KGTK::gtk_file_chooser_get_uris Bypassing internal function\n\r"); fflush(stdout);
#endif
@ -1831,7 +1841,7 @@ gboolean gtk_file_chooser_set_current_folder_uri(GtkFileChooser *chooser, const
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_file_chooser_set_current_folder_uri");
determineAppName();
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
#ifdef KGTK_DEBUG
printf("KGTK::gtk_file_chooser_set_current_folder_uri Bypassing internal function\n\r"); fflush(stdout);
#endif
@ -1861,7 +1871,7 @@ gchar * gtk_file_chooser_get_current_folder_uri(GtkFileChooser *chooser)
realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_file_chooser_get_current_folder_uri");
determineAppName();
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
#ifdef KGTK_DEBUG
printf("KGTK::gtk_file_chooser_get_current_folder_uri Bypassing internal function\n\r"); fflush(stdout);
#endif
@ -1916,7 +1926,7 @@ GtkWidget * gtk_dialog_add_button(GtkDialog *dialog, const gchar *button_text, g
dlg = realFunction(dialog, button_text, response_id);
determineAppName();
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED) && realFunction) {
#ifdef KGTK_DEBUG
printf("KGTK::gtk_dialog_add_button Bypassing internal function\n\r"); fflush(stdout);
#endif
@ -1956,7 +1966,7 @@ void gtk_dialog_add_buttons(GtkDialog *dialog, const gchar *first_button_text, .
va_end(varargs);
determineAppName();
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED)) {
#ifdef KGTK_DEBUG
printf("KGTK::gtk_dialog_add_buttons Bypassing internal function\n\r"); fflush(stdout);
#endif
@ -2005,7 +2015,7 @@ GtkWidget * gtk_file_chooser_dialog_new(const gchar *title, GtkWindow *parent,
va_end(varargs);
determineAppName();
if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) {
if (((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS) || (kgtkApp == APP_BLACKLISTED)) {
#ifdef KGTK_DEBUG
printf("KGTK::gtk_file_chooser_dialog_new Bypassing internal function\n\r"); fflush(stdout);
#endif

Loading…
Cancel
Save