1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-07 11:37:35 +00:00

FileManager: Added properties dialog

The user can rename files, change the permissions and view different
properties of the file.
This commit is contained in:
Till Mayer 2019-11-20 21:52:15 +01:00 committed by Andreas Kling
parent e630ad5927
commit b0b523e973
7 changed files with 389 additions and 33 deletions

View file

@ -4,6 +4,7 @@
#include <LibCore/CNotifier.h>
#include <LibGUI/GModel.h>
#include <sys/stat.h>
#include <time.h>
class GDirectoryModel final : public GModel
, public Weakable<GDirectoryModel> {
@ -58,6 +59,20 @@ public:
return m_files[index - m_directories.size()];
}
GIcon icon_for_file(const mode_t mode, const String name) const;
static String timestamp_string(time_t timestamp)
{
auto* tm = localtime(&timestamp);
return String::format("%4u-%02u-%02u %02u:%02u:%02u",
tm->tm_year + 1900,
tm->tm_mon + 1,
tm->tm_mday,
tm->tm_hour,
tm->tm_min,
tm->tm_sec);
}
private:
GDirectoryModel();