[fondue-commits] [SCM] Fondue Font Editor branch, master, updated. 9244b062f6474ab42379f03f66445023683278d1

Eugeniy Meshcheryakov eugen at debian.org
Fri Jan 4 21:03:51 UTC 2008


The branch, master has been updated
       via  9244b062f6474ab42379f03f66445023683278d1 (commit)
      from  205db8b90d51df350ea98143e2b53dcb5e901eef (commit)


- Shortlog ------------------------------------------------------------
9244b06 make sure that model index passed to GlyphEditWidget is valid so fondue does not segfault

Summary of changes:
 gui/mainwindow.cxx |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
Details of changes:

commit 9244b062f6474ab42379f03f66445023683278d1
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Fri Jan 4 22:03:37 2008 +0100

    make sure that model index passed to GlyphEditWidget is valid so fondue does not segfault

diff --git a/gui/mainwindow.cxx b/gui/mainwindow.cxx
index ac09c14..4fb355f 100644
--- a/gui/mainwindow.cxx
+++ b/gui/mainwindow.cxx
@@ -399,8 +399,12 @@ void MainWindow::editGlyph(const QModelIndex &index)
 
 	QAbstractProxyModel *proxy = qobject_cast<QAbstractProxyModel *>(glyphsView->model());
 	if (proxy) {
-		GlyphEditWidget *editor = new GlyphEditWidget(this, qobject_cast<GlyphsModel *>(proxy->sourceModel()), proxy->mapToSource(index));
-		editor->show();
+		QModelIndex sourceIndex = proxy->mapToSource(index);
+		if (sourceIndex.isValid()) {
+			GlyphEditWidget *editor = new GlyphEditWidget(this,
+					qobject_cast<GlyphsModel *>(proxy->sourceModel()), sourceIndex);
+			editor->show();
+		}
 	}
 }
 

-- 
Fondue Font Editor



More information about the fondue-commits mailing list