summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@shlomifish.org>2017-02-28 21:33:57 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2017-02-28 21:33:57 +0000
commitc0ddce54924a89813453185c7a7fc26f0f5217d2 (patch)
treefc51216d99f5fb925e2bd2a9cc4d2c55ac1197c4 /src/extension
parentAdd some comment. Comment out unused signals. (diff)
parentMerged. (diff)
downloadinkscape-c0ddce54924a89813453185c7a7fc26f0f5217d2.tar.gz
inkscape-c0ddce54924a89813453185c7a7fc26f0f5217d2.zip
merge minor refactoring
(bzr r15555)
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/find_extension_by_mime.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/extension/find_extension_by_mime.h b/src/extension/find_extension_by_mime.h
new file mode 100644
index 000000000..1686c62e4
--- /dev/null
+++ b/src/extension/find_extension_by_mime.h
@@ -0,0 +1,36 @@
+/**
+ * @file
+ * Find an extension by its mime type.
+ */
+/* Authors:
+ * Lauris Kaplinski <lauris@kaplinski.com>
+ * Frank Felfe <innerspace@iname.com>
+ * bulia byak <buliabyak@users.sf.net>
+ * Jon A. Cruz <jon@joncruz.org>
+ * Abhishek Sharma
+ * Kris De Gussem <Kris.DeGussem@gmail.com>
+ *
+ * Copyright (C) 2012 Kris De Gussem
+ * Copyright (C) 2010 authors
+ * Copyright (C) 1999-2005 authors
+ * Copyright (C) 2004 David Turner
+ * Copyright (C) 2001-2002 Ximian, Inc.
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+namespace Inkscape {
+namespace Extension {
+static inline Inkscape::Extension::Extension *find_by_mime(const char *const mime)
+{
+
+ Inkscape::Extension::DB::InputList o;
+ Inkscape::Extension::db.get_input_list(o);
+ Inkscape::Extension::DB::InputList::const_iterator i = o.begin();
+ while (i != o.end() && strcmp((*i)->get_mimetype(), mime) != 0) {
+ ++i;
+ }
+ return *i;
+}
+}
+}