[Xfc-dev] [Patch] AboutDialog errors

Bjoern Paetzel kolrabi at kolrabi.de
Tue Jul 19 16:56:11 CEST 2005


Hi,

I'm using XFC 4.3.1 and I had problems using Xfc::Gtk::AboutDialog. I
found out, that the source code for it was rather broken and because of
an error in the makefiles it even isn't compiled which is the reason why
xfc compiles nicely. (Nobody ever tried using an about dialog?) Below is
a patch to make it work with the latest svn version. I was not sure
about calling DialogClass::init because AboutDialogClass is not
inherited from DialogClass, so I just commented it out for now. Also I
am worried about those (const gchar**) casts, there should be a better
way to do this, but I'm lazy  ;)


diff -ur xfcorig/libXFCui/xfc/gtk/aboutdialog.cc
xfc/libXFCui/xfc/gtk/aboutdialog.cc
--- xfcorig/libXFCui/xfc/gtk/aboutdialog.cc 2005-07-19
11:50:23.000000000 +0200
+++ xfc/libXFCui/xfc/gtk/aboutdialog.cc 2005-07-19 12:02:38.000000000 +0200
@@ -52,13 +52,13 @@
 Gtk::AboutDialog::AboutDialog(const char *name, const char *version,
const char *copyright, Gdk::Pixbuf *logo)
 : Dialog((GtkDialog*)gtk_about_dialog_new())
 {
- g_object_set(g_object(), "name", name, "version", version,
"copyright", copyright, "logo", logo.gdk_pixbuf(), 0);
+ g_object_set(g_object(), "name", name, "version", version,
"copyright", copyright, "logo", logo->gdk_pixbuf(), 0);
 }

 Gtk::AboutDialog::AboutDialog(const String& name, const String&
version, const String& copyright, Gdk::Pixbuf *logo)
 : Dialog((GtkDialog*)gtk_about_dialog_new())
 {
- g_object_set(g_object(), "name", name.c_str(), "version",
version.c_str(), "copyright", copyright.c_str(), "logo",
logo.gdk_pixbuf(), 0);
+ g_object_set(g_object(), "name", name.c_str(), "version",
version.c_str(), "copyright", copyright.c_str(), "logo",
logo->gdk_pixbuf(), 0);
 }

 Gtk::AboutDialog::~AboutDialog()
@@ -229,7 +229,7 @@
 Gtk::AboutDialog::set_authors(const std::vector<String>& authors)
 {
  char **tmp_authors = vector_to_array(authors);
- gtk_about_dialog_set_authors(gtk_about_dialog(), tmp_authors);
+ gtk_about_dialog_set_authors(gtk_about_dialog(), (const
gchar**)tmp_authors);
  delete [] tmp_authors;
 }

@@ -237,7 +237,7 @@
 Gtk::AboutDialog::set_documenters(const std::vector<String>& documenters)
 {
  char **tmp_documenters = vector_to_array(documenters);
- gtk_about_dialog_set_documenters(gtk_about_dialog(), documenters);
+ gtk_about_dialog_set_documenters(gtk_about_dialog(), (const gchar
**)tmp_documenters);
  delete [] tmp_documenters;
 }

@@ -245,7 +245,7 @@
 Gtk::AboutDialog::set_artists(const std::vector<String>& artists)
 {
  char **tmp_artists = vector_to_array(artists);
- gtk_about_dialog_set_artists(gtk_about_dialog(), artists);
+ gtk_about_dialog_set_artists(gtk_about_dialog(), (const gchar
**)tmp_artists);
  delete [] tmp_artists;
 }

@@ -282,7 +282,7 @@
  static void notify(GtkAboutDialog *about, const char *link, void *data)
  {
    LinkCallback *cb = static_cast<LinkCallback*>(data);
-   Gtk::AboutDialog *tmp_about = G::Object::wrap<Gtk::Dialog>(about);
+   Gtk::AboutDialog *tmp_about = G::Object::wrap<Gtk::AboutDialog>(about);
    String s(link);
    cb->slot_(*tmp_about, s);
  }
@@ -316,7 +316,8 @@
 void
 Gtk::AboutDialogClass::init(GtkAboutDialogClass *g_class)
 {
- DialogClass::init((GtkDialogClass*)g_class);
+  // BP: not sure about this one...
+ // DialogClass::init((GtkDialogClass*)g_class);
 }

 GType
@@ -341,8 +342,8 @@

 void
 Gtk::show_about_dialog(Window& window, Gdk::Pixbuf& logo, const char
*name, const char *version, const char *copyright,
-                       const char *website = 0, const char *comments =
0, const std::vector<String> *authors = 0,
-          const std::vector<String> *documenters = 0, const char
*license = 0)
+                       const char *website, const char *comments, const
std::vector<String> *authors,
+                       const std::vector<String> *documenters, const
char *license)
 {
  char **tmp_authors = authors ? vector_to_array(*authors) : 0;
  char **tmp_documenters = documenters ? vector_to_array(*documenters) : 0;
@@ -356,15 +357,15 @@
                        "comments", comments,
            "authors", tmp_authors,
            "documenters", tmp_documenters,
-           "license", license
+           "license", license,
            0);
 }

 void
 Gtk::show_about_dialog(Window& window, Gdk::Pixbuf& logo, const String&
name, const String& version,
-                       const String& copyright, const String& website =
0, const String& comments = 0,
-                       const std::vector<String> *authors = 0, const
std::vector<String> *documenters = 0,
-                       const String& license = 0)
+                       const String& copyright, const String& website,
const String& comments,
+                       const std::vector<String> *authors, const
std::vector<String> *documenters,
+                       const String& license)
 {
  show_about_dialog(window, logo, name.c_str(), version.c_str(),
copyright.c_str(), website.c_str(),
                    comments.c_str(), authors, documenters,
license.c_str());
diff -ur xfcorig/libXFCui/xfc/gtk/aboutdialog.hh
xfc/libXFCui/xfc/gtk/aboutdialog.hh
--- xfcorig/libXFCui/xfc/gtk/aboutdialog.hh 2005-07-19
11:50:23.000000000 +0200
+++ xfc/libXFCui/xfc/gtk/aboutdialog.hh 2005-07-19 11:58:19.000000000 +0200
@@ -46,7 +46,7 @@
 void show_about_dialog
 (
  Window& window,
- Gdk::Pixbuf& logo
+ Gdk::Pixbuf& logo,
  const char *name,
  const char *version,
  const char *copyright,
@@ -68,7 +68,7 @@
  const String& comments = 0,
  const std::vector<String> *authors = 0,
  const std::vector<String> *documenters = 0,
- const String& license = 0,
+ const String& license = 0
 );
 ///< This is a convenience function for showing an application's about box.
 ///< @param window The transient parent, or null for none.
diff -ur xfcorig/libXFCui/xfc/gtk/Makefile.am
xfc/libXFCui/xfc/gtk/Makefile.am
--- xfcorig/libXFCui/xfc/gtk/Makefile.am  2005-07-19 11:50:23.000000000
+0200
+++ xfc/libXFCui/xfc/gtk/Makefile.am  2005-07-19 11:51:25.000000000 +0200
@@ -197,7 +197,7 @@
  windowsignals.hh

 cc_sources = \
- aboutdialog.hh \
+ aboutdialog.cc \
  accelgroup.cc \
  accelgroupsignals.cc \
  accelkey.cc \

--
User ID:     kolrabi at kolrabi.de               Key ID: 72EC E385
Fingerprint: BE42 DE3C D0A9 566C CB94  B080 7A5F 1920 72EC E285
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://mail.xfce.org/pipermail/xfc-dev/attachments/20050719/82da0d85/attachment.pgp>


More information about the Xfc-dev mailing list