Commit Graph

17 Commits

Author SHA1 Message Date
Andreas Kling
9ac94d393e LibGfx: Rename from LibDraw :^) 2020-02-06 12:04:00 +01:00
Andreas Kling
11580babbf LibDraw: Put all classes in the Gfx namespace
I started adding things to a Draw namespace, but it somehow felt really
wrong seeing Draw::Rect and Draw::Bitmap, etc. So instead, let's rename
the library to LibGfx. :^)
2020-02-06 11:56:38 +01:00
Andreas Kling
c5bd9d4ed1 LibGUI: Put all classes in the GUI namespace and remove the leading G
This took me a moment. Welcome to the new world of GUI::Widget! :^)
2020-02-02 15:15:33 +01:00
Andreas Kling
2d39da5405 LibCore: Put all classes in the Core namespace and remove the leading C
I've been wanting to do this for a long time. It's time we start being
consistent about how this stuff works.

The new convention is:

- "LibFoo" is a userspace library that provides the "Foo" namespace.

That's it :^) This was pretty tedious to convert and I didn't even
start on LibGUI yet. But it's coming up next.
2020-02-02 15:15:30 +01:00
Sergey Bugaev
f9b4d981a8 LibGUI+FileManager: Try better to detect executables
We will now consider a file to be an executable if any of the executable
permission bits are set.
2020-01-28 15:08:27 +01:00
Andreas Kling
e7512ae2d1 GFileSystemModel: Don't copy the null-terminator after readlink() 2020-01-28 10:52:10 +01:00
Andreas Kling
f7b394af7d LibGUI: Add symlink targets as a column in GFileSystemModel
Also make sure to hide this column by default where we don't expect
to see it.
2020-01-27 22:19:05 +01:00
Andreas Kling
f2f0965edd LibGUI: Have GFileSystemModel use stat instead of lstat for the root
This allows you to set the GFileSystemModel root to a symlink to a
directory and it nicely opens that directory like you would expect.
2020-01-27 22:10:19 +01:00
Andreas Kling
82cb5b6f64 LibGUI: GFileSystemModel::index() now survives negative inputs
If asked to create an index with negative row and/or column, we should
just return an invalid GModelIndex() instead of asserting.
2020-01-21 21:55:25 +01:00
Andreas Kling
94ca55cefd Meta: Add license header to source files
As suggested by Joshua, this commit adds the 2-clause BSD license as a
comment block to the top of every source file.

For the first pass, I've just added myself for simplicity. I encourage
everyone to add themselves as copyright holders of any file they've
added or modified in some significant way. If I've added myself in
error somewhere, feel free to replace it with the appropriate copyright
holder instead.

Going forward, all new source files should include a license header.
2020-01-18 09:45:54 +01:00
Sergey Bugaev
fdeb91e000 LibGUI+FileManager: Merge GDirectoryModel into GFileSystemModel
We used to have two different models for displaying file system contents:
the FileManager-grade table-like directory model, which exposed rich data
(such as file icons with integrated image previews) about contents of a
single directory, and the tree-like GFileSystemModel, which only exposed
a tree of file names with very basic info about them.

This commit unifies the two. The new GFileSystemModel can be used both as a
tree-like and as a table-like model, or in fact in both ways simultaneously.
It exposes rich data about a file system subtree rooted at the given root.

The users of the two previous models are all ported to use this new model.
2020-01-10 17:45:59 +01:00
Tommy Nguyen
2bd640277e LibGUI: Add missing call to did_update() when updating GFileSystemModel 2019-12-12 22:41:28 +01:00
Brandon Scott
a4d52b122d FileManager+LibGUI: Fix two folder-related crashes (#569)
Fix a crash when opening a folder, and another one when trying to open
a newly created folder.

It was not safe to modify a GModelSelection while it's being iterated over.

Fixes #536.
2019-09-17 09:26:10 +02:00
Andreas Kling
fb18613e8a LibGUI: Convert various little things to GModelSelection
All the little things that were using the per-model seletion are now
moving over to GModelSelection.
2019-09-07 20:35:31 +02:00
Conrad Pankoff
9b6e99f17e LibGUI: Reify intermediate nodes during index traversal
In the event where you want to find the index of a deeply-nested path
with a GFileSystemModel that hasn't yet traversed most of that path, it
is possible for a false negative failure to occur. This failure is
caused by the GFileSystemModel incorrectly bailing out of the search
when it hits the first unseen path segment that is not at the very end
of the path.

This patch fixes this problem by reifying the intermediate nodes during
that search and traversal process.
2019-07-31 16:33:21 +02:00
Andreas Kling
954a0b8efe AK: Add a canonicalized_path() convenience function.
This is the same as calling FileSystemPath(foo).string(). The majority of
clients only care about canonicalizing a path, so let's have an easy way
to express that.
2019-07-15 06:50:32 +02:00
Andreas Kling
04b9dc2d30 Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch
moves the Lib*/ directories into Libraries/.
2019-07-04 16:16:50 +02:00