Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon cleanups #388

Merged
merged 8 commits into from Dec 3, 2014
Merged

Icon cleanups #388

merged 8 commits into from Dec 3, 2014

Commits on Dec 2, 2014

  1. qtutils: remove unused functions

    The icon_for_file() function and its only caller update_file_icons()
    were unused so remove them.
    
    Signed-off-by: Daniel Harding <dharding@living180.net>
    living180 committed Dec 2, 2014
    Copy the full SHA
    dc6c4e5 View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2014

  1. qtutils: rename mimetypes() to path_mimetypes()

    This will enable some later code refactoring by allowing Python's
    mimetypes module to be imported in the cola.qtutils module without
    a name collision.
    
    Signed-off-by: Daniel Harding <dharding@living180.net>
    living180 committed Dec 3, 2014
    Copy the full SHA
    bb10bf2 View commit details
    Browse the repository at this point in the history
  2. utils: refactor ident_file_type()

    * Rename KNOWN_FILE_EXTENSION to KNOWN_FILE_EXTENSIONS.
    * KNOWN_FILE_MIME_TYPES was never used for dictionary lookups (it was
      only iterated over), so convert it to a list of two-element tuples.
    * Convert the guessed mimetype to lowercase once instead of every time
      through the loop of KNOWN_FILE_MIME_TYPES.
    * Look up the filename's extension in the KNOWN_FILE_EXTENSIONS
      dictionary instead of iterating over it and testing with .endswith().
    
    Signed-off-by: Daniel Harding <dharding@living180.net>
    living180 committed Dec 3, 2014
    Copy the full SHA
    f9a14da View commit details
    Browse the repository at this point in the history
  3. qtutils: move icon functionality from utils

    The utils.file_icon() and supporting utils.ident_file_type() functions
    did not really belong in the utils module because they have to do with
    the QT UI.  The utils.file_icon() function was only used in one place,
    in the qtutils.icon_file() function, so inline its functionality there,
    and move ident_file_type() from utils to qtutils.
    
    Signed-off-by: Daniel Harding <dharding@living180.net>
    living180 committed Dec 3, 2014
    Copy the full SHA
    3363e40 View commit details
    Browse the repository at this point in the history
  4. qtutils: reduce calls to resources.icon()

    Change some of the icon functions to return icon names that get passed
    to a single call to resources.icon() in create_treeitem() instead of
    calling resources.icon() every time an icon is specified.
    
    Signed-off-by: Daniel Harding <dharding@living180.net>
    living180 committed Dec 3, 2014
    Copy the full SHA
    a6c8897 View commit details
    Browse the repository at this point in the history
  5. qtutils: rename some icon functions

    Rename ident_file_type() to icon_name_for_filename() and icon_file() to
    icon_name_for_file() to better reflect functionality.
    
    Signed-off-by: Daniel Harding <dharding@living180.net>
    living180 committed Dec 3, 2014
    Copy the full SHA
    46fc594 View commit details
    Browse the repository at this point in the history
  6. qtutils: use smaller icon for consistency

    daf997b added a new smaller staged icon
    for the status widget, but create_treeitem() was not updated to use the
    new icon when called with check=False.  Update create_treeitem() to use
    the smaller icon.
    
    Signed-off-by: Daniel Harding <dharding@living180.net>
    living180 committed Dec 3, 2014
    Copy the full SHA
    06a53de View commit details
    Browse the repository at this point in the history
  7. widgets/status: use icon for untracked files

    git-cola has an icon for untracked files, but it wasn't being used,
    because the StatusTreeWidget was not providing the correct argument to
    qtutils.create_treeitem().  Change StatusTreeWidget.set_untracked() to
    pass untracked=True to StatusTreeWidget._set_subtree(), which will pass
    that value on to qtutils.create_treeitem(), causing the desired icon to
    be used.
    
    Signed-off-by: Daniel Harding <dharding@living180.net>
    living180 committed Dec 3, 2014
    Copy the full SHA
    a3e9058 View commit details
    Browse the repository at this point in the history