]>
Commit | Line | Data |
---|---|---|
690ddfec VS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: src/gtk/filehistory.cpp | |
3 | // Purpose: GTK+ bits for wxFileHistory class | |
4 | // Author: Vaclav Slavik | |
5 | // Created: 2010-05-06 | |
6 | // RCS-ID: $Id$ | |
7 | // Copyright: (c) 2010 Vaclav Slavik | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | // ============================================================================ | |
12 | // declarations | |
13 | // ============================================================================ | |
14 | ||
15 | // ---------------------------------------------------------------------------- | |
16 | // headers | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
19 | // For compilers that support precompilation, includes "wx.h". | |
20 | #include "wx/wxprec.h" | |
21 | ||
22 | #ifdef __BORLANDC__ | |
23 | #pragma hdrstop | |
24 | #endif | |
25 | ||
26 | #include "wx/filehistory.h" | |
27 | ||
28 | #if wxUSE_FILE_HISTORY | |
29 | ||
30 | #include "wx/filename.h" | |
31 | ||
32 | #include <glib.h> | |
33 | #include <gtk/gtk.h> | |
34 | #include "wx/gtk/private/string.h" | |
c282e47d | 35 | #include "wx/gtk/private.h" |
690ddfec VS |
36 | |
37 | // ============================================================================ | |
38 | // implementation | |
39 | // ============================================================================ | |
40 | ||
41 | void wxFileHistory::AddFileToHistory(const wxString& file) | |
42 | { | |
43 | wxFileHistoryBase::AddFileToHistory(file); | |
44 | ||
45 | #ifdef __WXGTK210__ | |
46 | const wxString fullPath = wxFileName(file).GetFullPath(); | |
47 | if ( !gtk_check_version(2,10,0) ) | |
48 | { | |
c282e47d | 49 | wxGtkString uri(g_filename_to_uri(wxGTK_CONV_FN(fullPath), NULL, NULL)); |
690ddfec VS |
50 | |
51 | if ( uri ) | |
52 | gtk_recent_manager_add_item(gtk_recent_manager_get_default(), uri); | |
53 | } | |
54 | #endif | |
55 | } | |
56 | ||
57 | #endif // wxUSE_FILE_HISTORY |