Windows compatibility Tweaks
This commit is contained in:
parent
ce292d03e3
commit
eb7cf3297c
|
@ -63,7 +63,7 @@ public class FileManager : StreamInteractionModule, Object {
|
||||||
try {
|
try {
|
||||||
FileInfo file_info = file.query_info("*", FileQueryInfoFlags.NONE);
|
FileInfo file_info = file.query_info("*", FileQueryInfoFlags.NONE);
|
||||||
file_transfer.file_name = file_info.get_display_name();
|
file_transfer.file_name = file_info.get_display_name();
|
||||||
file_transfer.mime_type = file_info.get_content_type();
|
file_transfer.mime_type = Util.get_content_type(file_info);
|
||||||
file_transfer.size = (int)file_info.get_size();
|
file_transfer.size = (int)file_info.get_size();
|
||||||
file_transfer.input_stream = yield file.read_async();
|
file_transfer.input_stream = yield file.read_async();
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ public class FileManager : StreamInteractionModule, Object {
|
||||||
file_transfer.input_stream = yield file.read_async();
|
file_transfer.input_stream = yield file.read_async();
|
||||||
|
|
||||||
FileInfo file_info = file_transfer.get_file().query_info("*", FileQueryInfoFlags.NONE);
|
FileInfo file_info = file_transfer.get_file().query_info("*", FileQueryInfoFlags.NONE);
|
||||||
file_transfer.mime_type = file_info.get_content_type();
|
file_transfer.mime_type = Util.get_content_type(file_info);
|
||||||
|
|
||||||
file_transfer.state = FileTransfer.State.COMPLETE;
|
file_transfer.state = FileTransfer.State.COMPLETE;
|
||||||
} catch (Error e) {
|
} catch (Error e) {
|
||||||
|
|
|
@ -26,6 +26,25 @@ public class Util {
|
||||||
}
|
}
|
||||||
assert_not_reached();
|
assert_not_reached();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
public static string get_content_type(FileInfo fileInfo)
|
||||||
|
{
|
||||||
|
//#if WIN32
|
||||||
|
string fileName = fileInfo.get_name();
|
||||||
|
int fileNameLength = fileName.length;
|
||||||
|
int extIndex = fileName.index_of(".");
|
||||||
|
if (extIndex < fileNameLength)
|
||||||
|
{
|
||||||
|
string extension = fileName.substring(extIndex, fileNameLength - extIndex);
|
||||||
|
string mime_type = ContentType.get_mime_type(extension);
|
||||||
|
if (mime_type != null && mime_type.length != 0)
|
||||||
|
{
|
||||||
|
return mime_type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
return fileInfo.get_content_type();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,10 @@ public class MainWindow : Gtk.Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setup_unified() {
|
private void setup_unified() {
|
||||||
|
new Dino.Ui.ConversationSelector();
|
||||||
|
new Dino.Ui.ConversationSummary.ConversationView();
|
||||||
|
new Dino.Ui.ChatInput.View();
|
||||||
|
new Dino.Ui.GlobalSearch();
|
||||||
Builder builder = new Builder.from_resource("/im/dino/Dino/unified_main_content.ui");
|
Builder builder = new Builder.from_resource("/im/dino/Dino/unified_main_content.ui");
|
||||||
paned = (Paned) builder.get_object("paned");
|
paned = (Paned) builder.get_object("paned");
|
||||||
box.add(paned);
|
box.add(paned);
|
||||||
|
|
Loading…
Reference in a new issue