Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 116654 | Differences between
and this patch

Collapse All | Expand All

(-)beagle-0.1.4.old/Tiles/Tile.cs (-67 / +14 lines)
Lines 131-147 Link Here
131
			Process p = new Process ();
131
			Process p = new Process ();
132
			p.StartInfo.UseShellExecute = false;
132
			p.StartInfo.UseShellExecute = false;
133
133
134
			if ((!path.StartsWith ("\"")) && (!path.EndsWith ("\"")))
134
			if ((!path.StartsWith ("\"")) && (!path.EndsWith ("\"")))
135
				path = "\"" + path + "\"";
135
				path = "\"" + path + "\"";
136
#if ENABLE_DESKTOP_LAUNCH
136
			p.StartInfo.FileName = "kfmclient"; // KDE
137
			p.StartInfo.FileName = "desktop-launch";
137
			p.StartInfo.Arguments = " exec " + path; // KDE
138
			p.StartInfo.Arguments = path;
139
#else
140
			p.StartInfo.FileName = "nautilus";
141
			p.StartInfo.Arguments = "--no-desktop " + path;
142
#endif
143
			try {
138
			try {
144
				p.Start ();
139
				p.Start ();
145
			} catch (Exception e) {
140
			} catch (Exception e) {
146
				Console.WriteLine ("Cannot open folder: " + e);
141
				Console.WriteLine ("Cannot open folder: " + e);
147
			}
142
			}
Lines 155-220 Link Here
155
		protected void OpenFromMime (Hit hit,
150
		protected void OpenFromMime (Hit hit,
156
					     string command_fallback,
151
					     string command_fallback,
157
					     string args_fallback,
152
					     string args_fallback,
158
					     bool expects_uris_fallback)
153
					     bool expects_uris_fallback)
159
		{
154
		{
160
			string argument;
155
			Process p = new Process (); // KDE
161
			string command = command_fallback;
156
			p.StartInfo.UseShellExecute = false; // KDE
162
			bool expects_uris = expects_uris_fallback;
157
			p.StartInfo.FileName = "kfmclient"; // KDE
163
158
			string argument = String.Format (" exec {0}", hit.PathQuoted); // KDE
164
			// FIXME: This is evil.  Nautilus should be handling
159
			p.StartInfo.Arguments = argument; // KDE
165
			// inode/directory, not just x-directory/normal
166
			if (hit.MimeType == "inode/directory")
167
				hit.MimeType = "x-directory/normal";
168
#if ENABLE_DESKTOP_LAUNCH
169
			command = "desktop-launch";
170
			expects_uris = true;
171
#else		       
172
			GnomeFu.VFSMimeApplication app;
173
			app = GnomeFu.GetDefaultAction (hit.MimeType);
174
			if (app.command != null) {
175
				command = app.command;
176
				expects_uris = (app.expects_uris != GnomeFu.VFSMimeApplicationArgumentType.Path);
177
			}
178
#endif			
179
			if (command == null) {
180
				LaunchError ("Can't open MimeType '{0}'", hit.MimeType);
181
				return;
182
			}
183
184
			if (args_fallback != null)
185
				argument = args_fallback;
186
			else 
187
				argument = "";			
188
189
			if (expects_uris) {
190
				argument = String.Format ("{0} '{1}'", argument, hit.Uri);
191
			} else {
192
				argument = String.Format ("{0} {1}", argument, hit.PathQuoted);
193
			}
194
195
			// Sometimes the command is 'quoted'
196
			if (command.IndexOf ('\'') == 0 && command.LastIndexOf ('\'') == command.Length - 1)
197
				command = command.Trim ('\'');
198
199
			// This won't work if a program really has a space in
200
			// the filename, but I think other things would break
201
			// with that too, and in practice it doesn't seem to
202
			// happen.
203
			int idx = command.IndexOf (' ');
204
			if (idx != -1) {
205
				argument = String.Format ("{0} {1}", command.Substring (idx + 1), argument);
206
				command = command.Substring (0, idx);
207
			}
208
209
			Console.WriteLine ("Cmd: {0}", command);
210
			Console.WriteLine ("Arg: {0}", argument);
211
212
			Process p = new Process ();
213
			p.StartInfo.UseShellExecute = false;
214
			p.StartInfo.FileName = command;
215
			p.StartInfo.Arguments = argument;
216
160
217
			try {
161
			try {
218
				p.Start ();
162
				p.Start ();
219
			} catch (Exception e) {
163
			} catch (Exception e) {
220
				Console.WriteLine ("Error in OpenFromMime: " + e);
164
				Console.WriteLine ("Error in OpenFromMime: " + e);
Lines 248-272 Link Here
248
				return;
192
				return;
249
			}
193
			}
250
			
194
			
251
			Process p = new Process ();
195
			Process p = new Process ();
252
			p.StartInfo.UseShellExecute = false;
196
			p.StartInfo.UseShellExecute = false;
253
			p.StartInfo.FileName        = "evolution";
197
			p.StartInfo.FileName        = "kmail";
254
			p.StartInfo.Arguments       = "\"mailto:";
198
			p.StartInfo.Arguments       = "";
255
199
256
			if (email != null && email != "")
200
			if (email != null && email != "")
257
				p.StartInfo.Arguments += email;
201
				p.StartInfo.Arguments += email;
258
202
259
			if (attach != null && attach != "")
203
			if (attach != null && attach != "")
260
				p.StartInfo.Arguments += "?attach=" + attach;
204
				p.StartInfo.Arguments += " --attach \"" + attach + "\"";
205
206
			if (email != null && email != "")
207
                                p.StartInfo.Arguments += " \"" + email + "\"";
261
208
262
			p.StartInfo.Arguments += "\"";
209
			p.StartInfo.Arguments += "\"";
263
210
264
			try {
211
			try {
265
				p.Start () ;
212
				p.Start () ;
266
			} catch (Exception e) {
213
			} catch (Exception e) {
267
				Console.WriteLine ("Error launching Evolution composer: " + e);
214
				Console.WriteLine ("Error launching Kmail composer: " + e);
268
			}
215
			}
269
		}
216
		}
270
217
271
		protected void SendIm (string protocol,
218
		protected void SendIm (string protocol,
272
				       string screenname)
219
				       string screenname)
(-)beagle-0.1.4.old/Tiles/TileLauncher.cs (-14 / +1 lines)
Lines 71-94 Link Here
71
				return null;
71
				return null;
72
			if (path.StartsWith ("/")) {
72
			if (path.StartsWith ("/")) {
73
				// don't worry about themes
73
				// don't worry about themes
74
				return path;
74
				return path;
75
			} else {
75
			} else {
76
				IconTheme icon_theme = new IconTheme ();
76
				// Always use KDE icons
77
				int base_size;
78
				string icon_path;
79
80
				// Try GNOME Icons
81
				if (path.EndsWith (".png")) 
82
					icon_path = icon_theme.LookupIcon (path.Substring (0, path.Length-4), -1, IconData.Zero, out base_size);
83
				else
84
					icon_path = icon_theme.LookupIcon (path, -1, IconData.Zero, out base_size);
85
86
				if (icon_path != null)
87
					return icon_path;
88
89
				// Fall back to KDE icons
90
				return BU.KdeUtils.LookupIcon (path);
77
				return BU.KdeUtils.LookupIcon (path);
91
			}
78
			}
92
		}
79
		}
93
80
94
		// FIXME: This doesn't work for all locales
81
		// FIXME: This doesn't work for all locales
(-)beagle-0.1.4.old/Tiles/TileCanvas.cs (-4 / +5 lines)
Lines 98-113 Link Here
98
			string commandArgs = null;
98
			string commandArgs = null;
99
99
100
			if (uri.StartsWith (Uri.UriSchemeHttp)
100
			if (uri.StartsWith (Uri.UriSchemeHttp)
101
			    || uri.StartsWith (Uri.UriSchemeHttps)
101
			    || uri.StartsWith (Uri.UriSchemeHttps)
102
			    || uri.StartsWith (Uri.UriSchemeFile)) {
102
			    || uri.StartsWith (Uri.UriSchemeFile)) {
103
				command = "gnome-open";
103
				command = "kfmclient";
104
				commandArgs = "'" + uri + "'";
104
				commandArgs = " openURL '" + uri + "'";
105
			} else if (uri.StartsWith (Uri.UriSchemeMailto)) {
105
			} else if (uri.StartsWith (Uri.UriSchemeMailto)) {
106
				command = "evolution";
106
				command = "kmail";
107
				commandArgs = uri;
107
				commandArgs = " " + uri;
108
			}
108
			}
109
			System.Console.WriteLine ("Calling: {0}{1}", command, commandArgs);
109
110
110
			if (command != null) {
111
			if (command != null) {
111
				Process p = new Process ();
112
				Process p = new Process ();
112
				p.StartInfo.UseShellExecute = false;
113
				p.StartInfo.UseShellExecute = false;
113
				p.StartInfo.FileName = command;
114
				p.StartInfo.FileName = command;

Return to bug 116654