Skip to content

Commit

Permalink
Fixed error when XML was selected. Sometimes the application did not …
Browse files Browse the repository at this point in the history
…parsed properly or crashed #34
  • Loading branch information
Jaroslav Staněk (Datalife) committed Oct 7, 2021
1 parent 461b3ef commit be02b48
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<img src="https://img.shields.io/badge/License-GPL3-blue.svg?style=for-the-badge">
</a>
<a href="https://github.com/fleury08/prettifier/releases">
<img src="https://img.shields.io/badge/Release-v%201.2.6-orange.svg?style=for-the-badge">
<img src="https://img.shields.io/badge/Release-v%201.2.7-orange.svg?style=for-the-badge">
</a>
</p>

Expand Down
4 changes: 2 additions & 2 deletions data/com.github.fleury08.prettifier.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<p>Makes your outputs prettier, so you can read It like a human not like a machine.</p>
</description>
<releases>
<release version="1.2.6" date="2021-09-30">
<release version="1.2.7" date="2021-10-07">
<description>
<p>Fixed rounded corners. Thanks Jeyson Flores.</p>
<p>Fixed error when XML was selected. Sometimes the application did not parsed properly or crashed. Thanks Sergej Dobryak.</p>
</description>
</release>
</releases>
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('com.github.fleury08.prettifier', 'vala', 'c',
version : '1.2.6',
version : '1.2.7',
license: 'GPL-3.0'
)

Expand Down
2 changes: 1 addition & 1 deletion src/Main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class Main {
catch (Error error) {}

if (version) {
stdout.printf (App.Configs.Constants.PROGRAME_NAME
info (App.Configs.Constants.PROGRAME_NAME
+" "
+ App.Configs.Constants.VERSION + "\r\n");
return 0;
Expand Down
3 changes: 2 additions & 1 deletion src/Prettify.vala
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ namespace App{
}

public string prettify_xml(string text, int indent){
if(text.length == 0) return "";
var doc = Xml.Parser.parse_doc(text);
var error = Xml.get_last_error().message;
string pretty_xml;
int length;
doc->dump_memory_format(out pretty_xml,out length, true);
var error = Xml.get_last_error().message;
if(length == 0) return error;
return pretty_xml;
}
Expand Down
2 changes: 1 addition & 1 deletion src/configs/Constants.vala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace App.Configs {
public class Constants {

public abstract const string ID = "com.github.fleury08.prettifier";
public abstract const string VERSION = "1.2.6";
public abstract const string VERSION = "1.2.7";
public abstract const string PROGRAME_NAME = "Prettifier";
public abstract const string APP_YEARS = "2019";
public abstract const string APP_ICON = "com.github.fleury08.prettifier";
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/HeaderBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace App.Widgets {
Application.settings.set_enum ("selected-format", prettify.type_of_file);
if(auto_prettify.active) prettify_action();
});
this.format_combobox.active = Application.settings.get_enum ("selected-format");


//Auto prettify button setup
this.auto_prettify.active = Application.settings.get_boolean ("auto-prettify");
Expand Down

0 comments on commit be02b48

Please sign in to comment.