Adding upstream version 0.11.1~13-g4aa2bb6.

Alf Gaida 9 years ago
parent 25794f3459
commit cf1878b64e

9
.gitignore vendored

@ -1,9 +0,0 @@
build*/
# Vim.gitignore
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~

@ -3,4 +3,4 @@ Upstream Authors:
Hong Jen Yee (PCMan) <pcman.tw@gmail.com> Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
Copyright: Copyright:
Copyright (c) 2013-2015 LXQt team Copyright (c) 2013-2016 LXQt team

@ -32,6 +32,8 @@ endif()
find_package(Qt5Widgets "${REQUIRED_QT_VERSION}" REQUIRED) find_package(Qt5Widgets "${REQUIRED_QT_VERSION}" REQUIRED)
find_package(Qt5LinguistTools "${REQUIRED_QT_VERSION}" REQUIRED) find_package(Qt5LinguistTools "${REQUIRED_QT_VERSION}" REQUIRED)
find_package(Qt5X11Extras "${REQUIRED_QT_VERSION}" REQUIRED) find_package(Qt5X11Extras "${REQUIRED_QT_VERSION}" REQUIRED)
#Note: no run-time dependency on liblxqt, just a build dependency for lxqt_translate_ts/desktop
find_package(lxqt REQUIRED)
find_package(PkgConfig) find_package(PkgConfig)
pkg_check_modules(SYSTEM_LIBS REQUIRED pkg_check_modules(SYSTEM_LIBS REQUIRED

@ -1,107 +0,0 @@
#=============================================================================
# The lxqt_translate_desktop() function was copied from the the
# LXQt LxQtTranste.cmake
#
# Original Author: Alexander Sokolov <sokoloff.a@gmail.com>
#
# funtion lxqt_translate_desktop(_RESULT
# SOURCES <sources>
# [TRANSLATION_DIR] translation_directory
# )
# Output:
# _RESULT The generated .desktop (.desktop) files
#
# Input:
#
# SOURCES List of input desktop files (.destktop.in) to be translated
# (merged), relative to the CMakeList.txt.
#
# TRANSLATION_DIR Optional path to the directory with the .ts files,
# relative to the CMakeList.txt. Defaults to
# "translations".
#
#=============================================================================
function(lxqt_translate_desktop _RESULT)
# Parse arguments ***************************************
set(oneValueArgs TRANSLATION_DIR)
set(multiValueArgs SOURCES)
cmake_parse_arguments(_ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
# check for unknown arguments
set(_UNPARSED_ARGS ${_ARGS_UNPARSED_ARGUMENTS})
if (NOT ${_UNPARSED_ARGS} STREQUAL "")
MESSAGE(FATAL_ERROR
"Unknown arguments '${_UNPARSED_ARGS}'.\n"
"See lxqt_translate_desktop() documenation for more information.\n"
)
endif()
if (NOT DEFINED _ARGS_SOURCES)
set(${_RESULT} "" PARENT_SCOPE)
return()
else()
set(_sources ${_ARGS_SOURCES})
endif()
if (NOT DEFINED _ARGS_TRANSLATION_DIR)
set(_translationDir "translations")
else()
set(_translationDir ${_ARGS_TRANSLATION_DIR})
endif()
get_filename_component (_translationDir ${_translationDir} ABSOLUTE)
foreach (_inFile ${_sources})
get_filename_component(_inFile ${_inFile} ABSOLUTE)
get_filename_component(_fileName ${_inFile} NAME_WE)
#Extract the real extension ............
get_filename_component(_fileExt ${_inFile} EXT)
string(REPLACE ".in" "" _fileExt ${_fileExt})
#.......................................
set(_outFile "${CMAKE_CURRENT_BINARY_DIR}/${_fileName}${_fileExt}")
file(GLOB _translations
${_translationDir}/${_fileName}_*${_fileExt}
${_translationDir}/local/${_fileName}_*${_fileExt}
)
set(_pattern "'\\[.*]\\s*='")
if (_translations)
add_custom_command(OUTPUT ${_outFile}
COMMAND grep -v "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
COMMAND grep -h ${_pattern} ${_translations} >> ${_outFile}
COMMENT "Generating ${_fileName}${_fileExt}"
)
else()
add_custom_command(OUTPUT ${_outFile}
COMMAND grep -v "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
COMMENT "Generating ${_fileName}${_fileExt}"
)
endif()
set(__result ${__result} ${_outFile})
# TX file ***********************************************
set(_txFile "${CMAKE_BINARY_DIR}/tx/${_fileName}${_fileExt}.tx.sh")
string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_translationDir ${_translationDir})
string(REPLACE "${CMAKE_SOURCE_DIR}/" "" _tx_inFile ${_inFile})
string(REPLACE "." "" _fileType ${_fileExt})
file(WRITE ${_txFile}
"[ -f ${_inFile} ] || exit 0\n"
"echo '[lxde-qt.${_fileName}_${_fileType}]'\n"
"echo 'type = DESKTOP'\n"
"echo 'source_lang = en'\n"
"echo 'source_file = ${_tx_inFile}'\n"
"echo 'file_filter = ${_tx_translationDir}/${_fileName}_<lang>${_fileExt}'\n"
"echo ''\n"
)
endforeach()
set(${_RESULT} ${__result} PARENT_SCOPE)
endfunction(lxqt_translate_desktop)

@ -1,131 +0,0 @@
#=============================================================================
# Copyright 2014 Luís Pereira <luis.artur.pereira@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
#
# funtion lxqt_translate_ts(qmFiles
# [USE_QT5 [Yes | No]]
# [UPDATE_TRANSLATIONS [Yes | No]]
# SOURCES <sources>
# [TEMPLATE] translation_template
# [TRANSLATION_DIR] translation_directory
# [INSTALL_DIR] install_directory
# )
# Output:
# qmFiles The generated compiled translations (.qm) files
#
# Input:
# USE_QT5 Optional flag to choose between Qt4 and Qt5. Defaults to Qt5
#
# UPDATE_TRANSLATIONS Optional flag. Setting it to Yes, extracts and
# compiles the translations. Setting it No, only
# compiles them.
#
# TEMPLATE Optional translations files base name. Defaults to
# ${PROJECT_NAME}. An .ts extensions is added.
#
# TRANSLATION_DIR Optional path to the directory with the .ts files,
# relative to the CMakeList.txt. Defaults to
# "translations".
#
# INSTALL_DIR Optional destination of the file compiled files (qmFiles).
# If not present no installation is performed
# CMake v2.8.3 needed to use the CMakeParseArguments module
cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
# We use our patched version to round a annoying bug.
include(Qt5PatchedLinguistToolsMacros)
function(lxqt_translate_ts qmFiles)
set(oneValueArgs USE_QT5 UPDATE_TRANSLATIONS TEMPLATE TRANSLATION_DIR INSTALL_DIR)
set(multiValueArgs SOURCES)
cmake_parse_arguments(TR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if (NOT DEFINED TR_UPDATE_TRANSLATIONS)
set(TR_UPDATE_TRANSLATIONS "No")
endif()
if (NOT DEFINED TR_USE_QT5)
set(TR_USE_QT5 "Yes")
endif()
if(NOT DEFINED TR_TEMPLATE)
set(TR_TEMPLATE "${PROJECT_NAME}")
endif()
if (NOT DEFINED TR_TRANSLATION_DIR)
set(TR_TRANSLATION_DIR "translations")
endif()
file(GLOB tsFiles "${TR_TRANSLATION_DIR}/${TR_TEMPLATE}_*.ts")
set(templateFile "${TR_TRANSLATION_DIR}/${TR_TEMPLATE}.ts")
if(TR_USE_QT5)
# Qt5
if (TR_UPDATE_TRANSLATIONS)
qt5_patched_create_translation(QMS
${TR_SOURCES}
${templateFile}
OPTIONS -locations absolute
)
qt5_patched_create_translation(QM
${TR_SOURCES}
${tsFiles}
OPTIONS -locations absolute
)
else()
qt5_patched_add_translation(QM ${tsFiles})
endif()
else()
# Qt4
if(TR_UPDATE_TRANSLATIONS)
qt4_create_translation(QMS
${TR_SOURCES}
${templateFile}
OPTIONS -locations absolute
)
qt4_create_translation(QM
${TR_SOURCES}
${tsFiles}
OPTIONS -locations absolute
)
else()
qt4_add_translation(QM ${tsFiles})
endif()
endif()
if(TR_UPDATE_TRANSLATIONS)
add_custom_target("update_${TR_TEMPLATE}_ts" ALL DEPENDS ${QMS})
endif()
if(DEFINED TR_INSTALL_DIR)
install(FILES ${QM} DESTINATION ${TR_INSTALL_DIR})
endif()
set(${qmFiles} ${QM} PARENT_SCOPE)
endfunction()

@ -1,112 +0,0 @@
#=============================================================================
# Copyright 2005-2011 Kitware, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of Kitware, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
include(CMakeParseArguments)
function(QT5_PATCHED_CREATE_TRANSLATION _qm_files)
set(options)
set(oneValueArgs)
set(multiValueArgs OPTIONS)
cmake_parse_arguments(_LUPDATE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(_lupdate_files ${_LUPDATE_UNPARSED_ARGUMENTS})
set(_lupdate_options ${_LUPDATE_OPTIONS})
set(_my_sources)
set(_my_tsfiles)
foreach(_file ${_lupdate_files})
get_filename_component(_ext ${_file} EXT)
get_filename_component(_abs_FILE ${_file} ABSOLUTE)
if(_ext MATCHES "ts")
list(APPEND _my_tsfiles ${_abs_FILE})
else()
list(APPEND _my_sources ${_abs_FILE})
endif()
endforeach()
foreach(_ts_file ${_my_tsfiles})
if(_my_sources)
# make a list file to call lupdate on, so we don't make our commands too
# long for some systems
# get_filename_component(_ts_name ${_ts_file} NAME_WE)
get_filename_component(_name ${_ts_file} NAME)
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _ts_name ${_name})
set(_ts_lst_file "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lst_file")
set(_lst_file_srcs)
foreach(_lst_file_src ${_my_sources})
set(_lst_file_srcs "${_lst_file_src}\n${_lst_file_srcs}")
endforeach()
get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
foreach(_pro_include ${_inc_DIRS})
get_filename_component(_abs_include "${_pro_include}" ABSOLUTE)
set(_lst_file_srcs "-I${_pro_include}\n${_lst_file_srcs}")
endforeach()
file(WRITE ${_ts_lst_file} "${_lst_file_srcs}")
endif()
add_custom_command(OUTPUT ${_ts_file}
COMMAND ${Qt5_LUPDATE_EXECUTABLE}
ARGS ${_lupdate_options} "@${_ts_lst_file}" -ts ${_ts_file}
DEPENDS ${_my_sources} ${_ts_lst_file} VERBATIM)
endforeach()
qt5_patched_add_translation(${_qm_files} ${_my_tsfiles})
set(${_qm_files} ${${_qm_files}} PARENT_SCOPE)
endfunction()
function(QT5_PATCHED_ADD_TRANSLATION _qm_files)
foreach(_current_FILE ${ARGN})
get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
# get_filename_component(qm ${_abs_FILE} NAME_WE)
get_filename_component(_name ${_abs_FILE} NAME)
string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" qm ${_name})
get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION)
if(output_location)
file(MAKE_DIRECTORY "${output_location}")
set(qm "${output_location}/${qm}.qm")
else()
set(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
endif()
add_custom_command(OUTPUT ${qm}
COMMAND ${Qt5_LRELEASE_EXECUTABLE}
ARGS ${_abs_FILE} -qm ${qm}
DEPENDS ${_abs_FILE} VERBATIM
)
list(APPEND ${_qm_files} ${qm})
endforeach()
set(${_qm_files} ${${_qm_files}} PARENT_SCOPE)
endfunction()

@ -1,5 +1,3 @@
set(libfm_TRANSLATION_TEMPLATE ${PROJECT_NAME})
include_directories( include_directories(
"${LIBFM_INCLUDE_DIRS}" "${LIBFM_INCLUDE_DIRS}"
"${LIBFM_INCLUDEDIR}/libfm" # to workaround incorrect #include in fm-actions. "${LIBFM_INCLUDEDIR}/libfm" # to workaround incorrect #include in fm-actions.
@ -78,7 +76,11 @@ qt5_wrap_ui(libfm_UIS_H ${libfm_UIS})
lxqt_translate_ts(QM_FILES lxqt_translate_ts(QM_FILES
UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS} UPDATE_TRANSLATIONS ${UPDATE_TRANSLATIONS}
SOURCES ${libfm_SRCS} ${libfm_UIS} SOURCES ${libfm_SRCS} ${libfm_UIS}
TEMPLATE ${libfm_TRANSLATION_TEMPLATE} INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/libfm-qt/translations"
PULL_TRANSLATIONS ${PULL_TRANSLATIONS}
CLEAN_TRANSLATIONS ${CLEAN_TRANSLATIONS}
TRANSLATIONS_REPO ${TRANSLATIONS_REPO}
TRANSLATIONS_REFSPEC ${TRANSLATIONS_REFSPEC}
) )
add_library(${LIBFM_QT_LIBRARY_NAME} SHARED add_library(${LIBFM_QT_LIBRARY_NAME} SHARED
@ -130,11 +132,11 @@ install(FILES
COMPONENT Devel COMPONENT Devel
) )
file(GLOB libfm_HS "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
# install include header files (FIXME: can we make this cleaner? should dir name be versioned?) # install include header files (FIXME: can we make this cleaner? should dir name be versioned?)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" install(FILES ${libfm_HS}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libfm-qt" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libfm-qt"
COMPONENT Devel COMPONENT Devel
FILES_MATCHING PATTERN "*.h"
) )
generate_export_header(${LIBFM_QT_LIBRARY_NAME} generate_export_header(${LIBFM_QT_LIBRARY_NAME}
@ -188,11 +190,5 @@ else()
) )
endif() endif()
install(FILES
${QM_FILES}
DESTINATION "${CMAKE_INSTALL_DATADIR}/libfm-qt/translations"
COMPONENT Runtime
)
# prevent the generated files from being deleted during make cleaner # prevent the generated files from being deleted during make cleaner
set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM true) set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM true)

@ -126,7 +126,7 @@
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Mime type:</string> <string>MIME type:</string>
</property> </property>
</widget> </widget>
</item> </item>

@ -99,7 +99,7 @@ void FileMenu::createMenu(FmFileInfoList* files, FmFileInfo* info, FmPath* cwd)
openWithMenuAction_ = new QAction(tr("Open With..."), this); openWithMenuAction_ = new QAction(tr("Open With..."), this);
addAction(openWithMenuAction_); addAction(openWithMenuAction_);
// create the "Open with..." sub menu // create the "Open with..." sub menu
QMenu* menu = new QMenu(); QMenu* menu = new QMenu(this);
openWithMenuAction_->setMenu(menu); openWithMenuAction_->setMenu(menu);
if(sameType_) { /* add specific menu items for this mime type */ if(sameType_) { /* add specific menu items for this mime type */
@ -116,11 +116,13 @@ void FileMenu::createMenu(FmFileInfoList* files, FmFileInfo* info, FmPath* cwd)
g_free(program_path); g_free(program_path);
// create a QAction for the application. // create a QAction for the application.
AppInfoAction* action = new AppInfoAction(app); AppInfoAction* action = new AppInfoAction(app, menu);
connect(action, &QAction::triggered, this, &FileMenu::onApplicationTriggered); connect(action, &QAction::triggered, this, &FileMenu::onApplicationTriggered);
menu->addAction(action); menu->addAction(action);
} }
g_list_free(apps); /* don't unref GAppInfos now */ // unref GAppInfos here, they are still ref'ed in the AppInfoActions above
g_list_foreach(apps, (GFunc)g_object_unref, NULL);
g_list_free(apps);
} }
} }
menu->addSeparator(); menu->addSeparator();
@ -350,6 +352,7 @@ void FileMenu::onDeleteTriggered() {
void FileMenu::onUnTrashTriggered() { void FileMenu::onUnTrashTriggered() {
FmPathList* paths = fm_path_list_new_from_file_info_list(files_); FmPathList* paths = fm_path_list_new_from_file_info_list(files_);
FileOperation::unTrashFiles(paths); FileOperation::unTrashFiles(paths);
fm_path_list_unref(paths);
} }
void FileMenu::onPasteTriggered() { void FileMenu::onPasteTriggered() {

@ -51,7 +51,7 @@ FileOperationDialog::FileOperationDialog(FileOperation* _operation):
break; break;
case FM_FILE_OP_DELETE: case FM_FILE_OP_DELETE:
title = tr("Delete Files"); title = tr("Delete Files");
message = tr("Deleting the following files"); message = tr("Deleting the following files:");
ui->dest->hide(); ui->dest->hide();
ui->destLabel->hide(); ui->destLabel->hide();
break; break;

@ -69,17 +69,26 @@ FilePropsDialog::FilePropsDialog(FmFileInfoList* files, QWidget* parent, Qt::Win
} }
FilePropsDialog::~FilePropsDialog() { FilePropsDialog::~FilePropsDialog() {
delete ui;
if(fileInfos_) if(fileInfos_)
fm_file_info_list_unref(fileInfos_); fm_file_info_list_unref(fileInfos_);
if(deepCountJob)
g_object_unref(deepCountJob); // Stop the timer if it's still running
if(fileSizeTimer) { if(fileSizeTimer) {
fileSizeTimer->stop(); fileSizeTimer->stop();
delete fileSizeTimer; delete fileSizeTimer;
fileSizeTimer = NULL; fileSizeTimer = NULL;
} }
// Cancel the indexing job if it hasn't finished
if(deepCountJob) {
g_signal_handlers_disconnect_by_func(deepCountJob, (gpointer)G_CALLBACK(onDeepCountJobFinished), this);
fm_job_cancel(FM_JOB(deepCountJob));
g_object_unref(deepCountJob);
deepCountJob = NULL;
}
// And finally delete the dialog's UI
delete ui;
} }
void FilePropsDialog::initApplications() { void FilePropsDialog::initApplications() {
@ -423,6 +432,29 @@ void FilePropsDialog::accept() {
op->run(); op->run();
} }
// Renaming
if(singleFile) {
QString new_name = ui->fileName->text();
if(QString::fromUtf8(fm_file_info_get_disp_name(fileInfo)) != new_name) {
FmPath* path = fm_file_info_get_path(fileInfo);
GFile* gf = fm_path_to_gfile(path);
GFile* parent_gf = g_file_get_parent(gf);
GFile* dest = g_file_get_child(G_FILE(parent_gf), new_name.toLocal8Bit().data());
g_object_unref(parent_gf);
GError* err = NULL;
if(!g_file_move(gf, dest,
GFileCopyFlags(G_FILE_COPY_ALL_METADATA |
G_FILE_COPY_NO_FALLBACK_FOR_MOVE |
G_FILE_COPY_NOFOLLOW_SYMLINKS),
NULL, NULL, NULL, &err)) {
QMessageBox::critical(this, QObject::tr("Error"), err->message);
g_error_free(err);
}
g_object_unref(dest);
g_object_unref(gf);
}
}
QDialog::accept(); QDialog::accept();
} }

@ -119,7 +119,7 @@ void FileSearchDialog::accept() {
fm_search_free(search); fm_search_free(search);
} }
else { else {
QMessageBox::critical(this, tr("Error"), tr("You should add at least add one directory to search.")); QMessageBox::critical(this, tr("Error"), tr("You should add at least one directory to search."));
return; return;
} }
QDialog::accept(); QDialog::accept();

@ -500,6 +500,11 @@ void FolderView::setViewMode(ViewMode _mode) {
listView->setItemDelegateForColumn(FolderModel::ColumnFileName, delegate); listView->setItemDelegateForColumn(FolderModel::ColumnFileName, delegate);
// FIXME: should we expose the delegate? // FIXME: should we expose the delegate?
listView->setMovement(QListView::Static); listView->setMovement(QListView::Static);
/* If listView is already visible, setMovement() will lay out items again with delay
(see Qt, QListView::setMovement(), d->doDelayedItemsLayout()) and thus drop events
will remain disabled for the viewport. So, we should re-enable drop events here. */
if(listView->viewport()->isVisible())
listView->viewport()->setAcceptDrops(true);
listView->setResizeMode(QListView::Adjust); listView->setResizeMode(QListView::Adjust);
listView->setWrapping(true); listView->setWrapping(true);
switch(mode) { switch(mode) {
@ -994,11 +999,11 @@ void FolderView::onFileClicked(int type, FmFileInfo* fileInfo) {
} }
else if(type == ContextMenuClick) { else if(type == ContextMenuClick) {
FmPath* folderPath = nullptr; FmPath* folderPath = nullptr;
FmFileInfoList* files = selectedFiles(); if (FmFileInfoList* files = selectedFiles()) {
if (files) {
FmFileInfo* first = fm_file_info_list_peek_head(files); FmFileInfo* first = fm_file_info_list_peek_head(files);
if (fm_file_info_list_get_length(files) == 1 && fm_file_info_is_dir(first)) if (fm_file_info_list_get_length(files) == 1 && fm_file_info_is_dir(first))
folderPath = fm_file_info_get_path(first); folderPath = fm_file_info_get_path(first);
fm_file_info_list_unref(files);
} }
if (!folderPath) if (!folderPath)
folderPath = path(); folderPath = path();

@ -163,6 +163,16 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<tabstops>
<tabstop>Anonymous</tabstop>
<tabstop>asUser</tabstop>
<tabstop>username</tabstop>
<tabstop>domain</tabstop>
<tabstop>password</tabstop>
<tabstop>forgetPassword</tabstop>
<tabstop>sessionPassword</tabstop>
<tabstop>storePassword</tabstop>
</tabstops>
<resources/> <resources/>
<connections> <connections>
<connection> <connection>

@ -72,9 +72,9 @@ RenameDialog::RenameDialog(FmFileInfo* src, FmFileInfo* dest, QWidget* parent, Q
.arg(QString::fromUtf8(fm_file_info_get_disp_mtime(dest))); .arg(QString::fromUtf8(fm_file_info_get_disp_mtime(dest)));
} }
else { else {
infoStr = QString(tr("Type: %1\nModified: %3")) infoStr = QString(tr("Type: %1\nModified: %2"))
.arg(QString::fromUtf8(fm_file_info_get_desc(src))) .arg(QString::fromUtf8(fm_file_info_get_desc(dest)))
.arg(QString::fromUtf8(fm_file_info_get_disp_mtime(src))); .arg(QString::fromUtf8(fm_file_info_get_disp_mtime(dest)));
} }
ui->destInfo->setText(infoStr); ui->destInfo->setText(infoStr);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save