You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
773 B
25 lines
773 B
#include "filesysteminfojob.h"
|
|
#include "gobjectptr.h"
|
|
|
|
namespace Fm {
|
|
|
|
void FileSystemInfoJob::exec() {
|
|
GObjectPtr<GFileInfo> inf = GObjectPtr<GFileInfo>{
|
|
g_file_query_filesystem_info(
|
|
path_.gfile().get(),
|
|
G_FILE_ATTRIBUTE_FILESYSTEM_SIZE","
|
|
G_FILE_ATTRIBUTE_FILESYSTEM_FREE,
|
|
cancellable().get(), nullptr),
|
|
false
|
|
};
|
|
if(!inf)
|
|
return;
|
|
if(g_file_info_has_attribute(inf.get(), G_FILE_ATTRIBUTE_FILESYSTEM_SIZE)) {
|
|
size_ = g_file_info_get_attribute_uint64(inf.get(), G_FILE_ATTRIBUTE_FILESYSTEM_SIZE);
|
|
freeSize_ = g_file_info_get_attribute_uint64(inf.get(), G_FILE_ATTRIBUTE_FILESYSTEM_FREE);
|
|
isAvailable_ = true;
|
|
}
|
|
}
|
|
|
|
} // namespace Fm
|