GNOME Archive Integration

Google Summer of Code 2013 project page

http://www.google-melange.com/gsoc/project/google/gsoc2013/lantw44/22001

Google Summer of Code 2013 final report

https://wiki.gnome.org/TingweiLan/GSoC2013Final

About the project

Archives are usually a convenient and efficient way to transfer folders over the Internet. If we have to transfer a lot of files, creating and extracting archives are our routine tasks, which can be simplified. The goal of the project is to add automatic archives creation and extraction support to regular GNOME applications.

Details

  • Shared library
    • gnome-autoar: It is a tiny library which uses libarchive and GIO as the backend to automatically create and extract archives and use GSettings as the backend to store and retrieve user preferences. It also uses some standard unix functions if available because some functions are not provided by GIO. It will be dynamically linked to applications to prevent incompatibility in GSettings. A pc file (pkg-config) is also privided.

  • Epiphany, Evolution, and Empathy

    • Archives will be automatically extracted after downloading is completed. Folders will be automatically compressed as an archive before uploading is started.
    • Users can decide whether they wants this feature. Users can find the settings in the preferences dialog of each applications.

Code

My code are available on my personal sites and GitHub. All new codes are in the "archive-integration" branch expect for gnome-autoar because it is a new library. However, there are some conflict in master branch and archive-integration branch in Epiphany, so I resolve the conflict and rebase all my works from master branch, creating another branch called archive-integration-rebase.

Note: Code on my personal sites and GitHub may be not up-to-date after GSoC. New patches will be available on GNOME Bugzilla and GNOME Git. In fact, some code are rewritten and it is not easy to push changes into existing branch.

Testing

Build gnome-autoar first.

git clone git://git.gnome.org/gnome-autoar gnome-autoar
cd gnome-autoar
./autogen.sh --enable-gtk-doc; make; make install

Then, you can build Epiphany with archive support.

git clone http://www.tfcis.org/~lantw44/git-fast/gsoc2013-epiphany epiphany -b archive-integration-rebase
cd epiphany
./autogen.sh; make; make install

You can also build Evolution with archive support.

git clone http://www.tfcis.org/~lantw44/git-fast/gsoc2013-evolution evolution -b archive-integration-review
cd evolution
./autogen.sh; make; make install

You can build Empathy with archive support.

git clone http://www.tfcis.org/~lantw44/git-fast/gsoc2013-empathy empathy -b archive-integration
cd empathy
./autogen.sh; make; make install

You can run Epiphany, Evolution, or Empathy now!

Dump archive preferences.

dconf dump /org/gnome/desktop/archives/

Progress

autoarchive is located in Epiphany source tree, but it does not depend on Epiphany except configure.ac.

autoarchive has been renamed to gnome-autoar! All code in the autoarchive directory has been moved to a separate repository. gnome-autoar use its own configure and Makefile to build itself.

  • Archives creation (done)
    • Support Multiple directories and files as sources (done)
    • Resolve hard links (done)
  • Archives extraction (partly done)
    • Check whether the archive contains a single top-level directory, so it will neither mess the download directory nor create extra directories. (done)
    • Remove absolute path names. (done)
    • Sanitize bad path names containing "..", so no files will be extracted to the location which is outside the destination. (done)
    • Ignore unneeded files when extracting. File name patterns can be configured using glob-style patterns. (done)
    • Provide asynchronous functions so it will not block UI. (done)
    • Handle files which is compressed by only a filter, such as gzip, bzip2, and xz without tar or cpio. (done)
    • Extraction should be cancellable. (done)
    • POSIX ACL support. (not started, optional)

  • Preferences (done)
    • GSettings reading and writing support. (done)
  • Formats and Filters (done)
    • Generate MIME types from formats and filters. (done)
    • Get file types description using GIO. (done)
  • Shared user interfaces (not completed)

    • A list for users to choose default archives creation format. (done)
    • A list for users to edit the unneeded file names pattern. (not started, optional)

    • A list for users to edit the file types should be considered as archives. (not started, optional)

Screenshot

<<< gnome-autoar >>>

gnome-autoar provides some common widgets to integrate archives support into applications.

Simple archive format chooser shows most-used archive formats.
Autoar-FormatFilter-Simple.png

Click "Other format" will activate the advanced archive format chooser to provide all available options.
Autoar-FormatFilter-Advanced.png


<<< Epiphany >>>

Epiphany has new options in preferences dialog now!
Epiphany-Preferences.png

Download panel (downloading)
Epiphany-Downloading.png

Download panel (checking the archive before extracting)
Epiphany-Checking.png

Download panel (extracting)
Epiphany-Extracting.png

Download panel (extraction finished)
Epiphany-Extraction-Finished.png

Upload dialog. Only single file is allowed in this web page, but we still can select multiple file because we can automatically create an archive for them!
Epiphany-Upload-Dialog.png

Upload progress and Cancellable. The "Stop Archiving" item only showed when there is an archiving work.
Epiphany-Upload-Creating-Archives.png


<<< Evolution >>>

Evolution has new options in attachment saving dialog!
Evolution-Attachment-Save-Dialog.png

Users can change set preferred file format when uploading directories!
Evolution-Attachment-Load-Dialog.png

Attachment bar (creating an archive for the directory)
Evolution-Attachment-Load-Creating.png

Attachment bar (An archive is successfully created for the directory)
Evolution-Attachment-Load-Creation-Finished.png


<<< Empathy >>>

Empathy will automatically create an archive if you want to send a directory.
Empathy-Creating-Progress.png

Empathy will send the archive after it is created.
Empathy-Sending-Archives.png

Empathy is going to receive file
Empathy-Receiving-Archives.png

Empathy is extracting files from the received archive
Empathy-Checking-Before-Extraction.png Empathy-Extracting-Archives.png

Outreach/SummerOfCode/2013/Projects/TingWeiLan_GnomeArchives (last edited 2013-12-03 18:34:15 by WilliamJonMcCann)