27
27
public override string Description {
28
get { return AddinManager.CurrentLocalizer.GetString ("Indexes your Opera 6 bookmarks"); }
28
get { return AddinManager.CurrentLocalizer.GetString ("Indexes your Opera bookmarks"); }
31
31
public override string Icon {
42
42
public override void UpdateItems ()
44
44
string home = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
45
string path = "~/.opera/opera6.adr".Replace ("~", home);
45
string[] paths = {"~/.opera/opera6.adr".Replace ("~", home),
46
"~/.opera/bookmarks.adr".Replace ("~", home)};
49
using (StreamReader streamReader = new StreamReader (path)) {
52
while((strName = streamReader.ReadLine ()) != null) {
53
if (!strName.Contains ("NAME")) continue;
55
strURL = streamReader.ReadLine ();
57
if (string.IsNullOrEmpty (strURL) || !strURL.Contains ("URL")) continue;
59
strName = strName.Replace ("NAME=", "");
60
strURL = strURL.Replace ("URL=", "");
61
items.Add (new BookmarkItem (strName, strURL));
49
foreach (string path in paths) {
50
if (File.Exists (path)) {
52
using (StreamReader streamReader = new StreamReader (path)) {
55
while((strName = streamReader.ReadLine ()) != null) {
56
if (!strName.Contains ("NAME")) continue;
58
strURL = streamReader.ReadLine ();
60
if (string.IsNullOrEmpty (strURL) || !strURL.Contains ("URL")) continue;
62
strName = strName.Replace ("NAME=", "");
63
strURL = strURL.Replace ("URL=", "");
64
items.Add (new BookmarkItem (strName, strURL));
67
} catch (Exception e) {
68
Log.Error ("Could not read Opera Bookmarks file {0}: {1}", path, e.Message);
69
Log.Debug (e.StackTrace);
66
Log.Error ("Could not read Opera Bookmarks file {0}: {1}", path, e.Message);
67
Log.Debug (e.StackTrace);