Skip to content

Commit

Permalink
Merge pull request #155 from torikulhabib/master
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
torikulhabib committed Jul 14, 2022
2 parents f2a627b + 1ded121 commit 2431baa
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 38 deletions.
2 changes: 1 addition & 1 deletion data/com.github.gabutakut.gabutdm.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<binary>com.github.gabutakut.gabutdm</binary>
</provides>
​ <releases>
<release version="1.8.5" date="2022-7-4">
<release version="1.8.6" date="2022-7-14">
<description>
<p>New With Gtk4</p>
</description>
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project ('com.github.gabutakut.gabutdm','vala', 'c', version: '1.8.5')
project ('com.github.gabutakut.gabutdm','vala', 'c', version: '1.8.6')

i18n = import ('i18n')

Expand Down
2 changes: 1 addition & 1 deletion src/CanonicalDbusmenu.vala
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace Gabut {
children += set_layouts (menuitem.id, menuitem.properties, {});
dbusmenumenuitem += set_item (menuitem.id, menuitem.properties);
});
items_properties_updated ({set_item (root.id, set_item_prop ({"children-display"}, {v_s ("submenu")}))}, {});
items_properties_updated ({set_item (root.id, set_item_prop ({"children-display"}, {new Variant.string ("submenu")}))}, {});
}

internal MenuItemLayout set_layouts (int id, GLib.HashTable<string, GLib.Variant> menu, Variant[] variant) {
Expand Down
8 changes: 4 additions & 4 deletions src/DbusmenuItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ namespace Gabut {

public DbusmenuItem () {
properties = new GLib.HashTable <string, Variant> (str_hash, str_equal);
properties["label"] = v_s ("Label Empty");
properties["enabled"] = v_b (true);
properties["visible"] = v_b (true);
properties["label"] = new Variant.string ("Label Empty");
properties["enabled"] = new Variant.boolean (true);
properties["visible"] = new Variant.boolean (true);
}

public string? property_get (string property) {
Expand Down Expand Up @@ -102,7 +102,7 @@ namespace Gabut {
public void child_append (DbusmenuItem child) {
if (menuchildren == null) {
menuchildren = new GLib.List<DbusmenuItem> ();
properties["children-display"] = v_s ("submenu");
properties["children-display"] = new Variant.string ("submenu");
}
if (!get_exist (child)) {
menuchildren.foreach ((item)=> {
Expand Down
2 changes: 1 addition & 1 deletion src/GabutServer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace Gabut {
if (msg.get_method () == "POST") {
string result = (string) msg.get_request_body ().data;
if (msg.get_request_headers ().get_content_type (null) == Soup.FORM_MIME_TYPE_MULTIPART) {
var multipart = new Soup.Multipart.from_message (msg.get_request_headers () , msg.get_request_body ().flatten ());
var multipart = new Soup.Multipart.from_message (msg.get_request_headers (), msg.get_request_body ().flatten ());
Soup.MessageHeaders headers;
GLib.Bytes body;
multipart.get_part (0, out headers, out body);
Expand Down
14 changes: 7 additions & 7 deletions src/GabutWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ namespace Gabut {

nodown_alert = new AlertView (
_("No File Download"),
_("insert Link, open file or Drag and Drop Torrent, Metalink, Magnet URIs."),
_("Drag and Drop URL, Torrent, Metalink, Magnet URIs."),
"com.github.gabutakut.gabutdm"
);
nodown_alert.show ();
Expand Down Expand Up @@ -660,7 +660,7 @@ namespace Gabut {
if (!item_visible) {
var empty_alert = new AlertView (
_("No Search Found"),
_("insert Link, open file or Drag and Drop Torrent, Metalink, Magnet URIs."),
_("Drag and Drop URL, Torrent, Metalink, Magnet URIs."),
"system-search"
);
empty_alert.show ();
Expand All @@ -675,7 +675,7 @@ namespace Gabut {
});
var active_alert = new AlertView (
_("No Active Download"),
_("insert Link, open file or Drag and Drop Torrent, Metalink, Magnet URIs."),
_("Drag and Drop URL, Torrent, Metalink, Magnet URIs."),
"com.github.gabutakut.gabutdm.active"
);
active_alert.show ();
Expand All @@ -687,7 +687,7 @@ namespace Gabut {
});
var nopause_alert = new AlertView (
_("No Paused Download"),
_("insert Link, open file or Drag and Drop Torrent, Metalink, Magnet URIs."),
_("Drag and Drop URL, Torrent, Metalink, Magnet URIs."),
"com.github.gabutakut.gabutdm.pause"
);
nopause_alert.show ();
Expand All @@ -699,7 +699,7 @@ namespace Gabut {
});
var nocomp_alerst = new AlertView (
_("No Complete Download"),
_("insert Link, open file or Drag and Drop Torrent, Metalink, Magnet URIs."),
_("Drag and Drop URL, Torrent, Metalink, Magnet URIs."),
"com.github.gabutakut.gabutdm.complete"
);
nocomp_alerst.show ();
Expand All @@ -711,7 +711,7 @@ namespace Gabut {
});
var nowait_alert = new AlertView (
_("No Waiting Download"),
_("insert Link, open file or Drag and Drop Torrent, Metalink, Magnet URIs."),
_("Drag and Drop URL, Torrent, Metalink, Magnet URIs."),
"com.github.gabutakut.gabutdm.waiting"
);
nowait_alert.show ();
Expand All @@ -723,7 +723,7 @@ namespace Gabut {
});
var noerr_alert = new AlertView (
_("No Error Download"),
_("insert Link, open file or Drag and Drop Torrent, Metalink, Magnet URIs."),
_("Drag and Drop URL, Torrent, Metalink, Magnet URIs."),
"com.github.gabutakut.gabutdm.error"
);
noerr_alert.show ();
Expand Down
10 changes: 5 additions & 5 deletions src/Preferences.vala
Original file line number Diff line number Diff line change
Expand Up @@ -448,20 +448,20 @@ namespace Gabut {
halign = Gtk.Align.CENTER,
valign = Gtk.Align.CENTER
};
int userid = 0;
int rowpos = 0;
get_users ().foreach ((user)=> {
userid++;
set_account (usergrid, user, userid);
rowpos++;
set_account (usergrid, user, rowpos);
});

add_auth.clicked.connect (()=> {
userid++;
rowpos++;
var users = UsersID ();
users.id = add_db_user (get_real_time ());;
users.activate = false;
users.user = "";
users.passwd = "";
set_account (usergrid, users, userid);
set_account (usergrid, users, rowpos);
});

var sharebutton = new Gtk.CheckButton.with_label (_("Folder Sharing:")) {
Expand Down
3 changes: 1 addition & 2 deletions src/SuccesDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ namespace Gabut {
};
((Gtk.Label) open_file.get_last_child ()).attributes = set_attribute (Pango.Weight.SEMIBOLD);
open_file.clicked.connect (()=> {
string[] datastrs = datastr.split ("<gabut>");
open_fileman.begin (File.new_for_path (datastrs[1]).get_uri ());
open_fileman.begin (File.new_for_path (info_succes (datastr, InfoSucces.FILEPATH)).get_uri ());
close ();
});
var close_button = new Gtk.Button.with_label (_("Close")) {
Expand Down
24 changes: 8 additions & 16 deletions src/Utils.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1997,13 +1997,6 @@ namespace Gabut {
return data.split ("<gabut>")[succes];
}

private Variant v_s (string data) {
return new Variant.string (data);
}
private Variant v_b (bool data) {
return new Variant.boolean (data);
}

private string fixtoformat (string tracker) {
var tracker0 = tracker.replace (" ", "").replace ("\n", ",").replace (",,", ",");
var tracker1 = tracker0.replace ("announcehttp://", "announce,http://").replace ("announce.phphttp://", "announce.php,http://");
Expand All @@ -2013,7 +2006,7 @@ namespace Gabut {
return tracker4;
}

private void set_account (Gtk.Grid usergrid, UsersID user, int userid) {
private void set_account (Gtk.Grid usergrid, UsersID user, int rowpos) {
var user_entry = new MediaEntry.activable ("avatar-default", "process-stop") {
width_request = 220,
margin_bottom = 4,
Expand Down Expand Up @@ -2042,25 +2035,24 @@ namespace Gabut {
});
pass_entry.sclicked.connect (()=> {
remove_user (user.id);
userid--;
usergrid.remove (user_entry);
usergrid.remove (pass_entry);
user_entry.destroy ();
pass_entry.destroy ();
});
usergrid.attach (user_entry, 0, userid);
usergrid.attach (pass_entry, 1, userid);
usergrid.attach (user_entry, 0, rowpos);
usergrid.attach (pass_entry, 1, rowpos);
}

private async void set_count_visible (int64 count) throws GLib.Error {
unowned UnityLauncherEntry instance = yield UnityLauncherEntry.get_instance ();
instance.set_app_property ("count-visible", v_b (count > 0));
instance.set_app_property ("count-visible", new Variant.boolean (count > 0));
instance.set_app_property ("count", new GLib.Variant.int64 (count));
}

private async void set_progress_visible (double progress, bool visible = true) throws GLib.Error {
unowned UnityLauncherEntry instance = yield UnityLauncherEntry.get_instance ();
instance.set_app_property ("progress-visible", v_b (visible));
instance.set_app_property ("progress-visible", new Variant.boolean (visible));
instance.set_app_property ("progress", new GLib.Variant.double (progress));
}

Expand All @@ -2072,7 +2064,7 @@ namespace Gabut {
quicksource = open_quicklist.callback;
unowned UnityLauncherEntry entrydbus = yield UnityLauncherEntry.get_instance ();
dbusserver.set_root (menuitem);
entrydbus.set_app_property ("quicklist", v_s (dbusserver.dbus_object));
entrydbus.set_app_property ("quicklist", new Variant.string (dbusserver.dbus_object));
yield;
}

Expand All @@ -2085,7 +2077,7 @@ namespace Gabut {
return "";
}
try {
FileInfo infos = fileinput.query_info ("standard::*", 0);
FileInfo infos = fileinput.query_info ("standard::*", GLib.FileQueryInfoFlags.NOFOLLOW_SYMLINKS);
return infos.get_content_type ();
} catch (Error e) {
GLib.warning (e.message);
Expand All @@ -2104,7 +2096,7 @@ namespace Gabut {
}

private string config_folder (string folder) {
var config_dir = File.new_for_path (GLib.Path.build_path (GLib.Path.DIR_SEPARATOR_S, Environment.get_user_config_dir (), folder));
var config_dir = File.new_build_filename (Environment.get_user_config_dir (), folder);
if (!config_dir.query_exists ()) {
try {
config_dir.make_directory_with_parents ();
Expand Down

0 comments on commit 2431baa

Please sign in to comment.