From f029a9011aea60f54ad63617cb9eaf3613ee72b0 Mon Sep 17 00:00:00 2001 From: Michal Sciubidlo Date: Sun, 27 Jan 2013 22:40:38 +0100 Subject: [PATCH] Move datafilespage to shared space. --- apps/launcher/CMakeLists.txt | 33 ------------------- apps/launcher/graphicspage.cpp | 3 +- apps/launcher/maindialog.cpp | 3 +- cmake/OpenMWMacros.cmake | 16 +++++++++ components/CMakeLists.txt | 12 ++++++- .../file_order_list}/datafilespage.cpp | 0 .../file_order_list}/datafilespage.hpp | 0 .../file_order_list}/model/datafilesmodel.cpp | 0 .../file_order_list}/model/datafilesmodel.hpp | 0 .../file_order_list}/model/esm/esmfile.cpp | 0 .../file_order_list}/model/esm/esmfile.hpp | 0 .../file_order_list}/model/modelitem.cpp | 0 .../file_order_list}/model/modelitem.hpp | 0 .../file_order_list}/utils/filedialog.cpp | 0 .../file_order_list}/utils/filedialog.hpp | 0 .../file_order_list}/utils/lineedit.cpp | 0 .../file_order_list}/utils/lineedit.hpp | 0 .../file_order_list}/utils/naturalsort.cpp | 0 .../file_order_list}/utils/naturalsort.hpp | 0 .../utils/profilescombobox.cpp | 0 .../utils/profilescombobox.hpp | 0 .../utils/textinputdialog.cpp | 0 .../utils/textinputdialog.hpp | 0 23 files changed, 30 insertions(+), 37 deletions(-) rename {apps/launcher => components/file_order_list}/datafilespage.cpp (100%) rename {apps/launcher => components/file_order_list}/datafilespage.hpp (100%) rename {apps/launcher => components/file_order_list}/model/datafilesmodel.cpp (100%) rename {apps/launcher => components/file_order_list}/model/datafilesmodel.hpp (100%) rename {apps/launcher => components/file_order_list}/model/esm/esmfile.cpp (100%) rename {apps/launcher => components/file_order_list}/model/esm/esmfile.hpp (100%) rename {apps/launcher => components/file_order_list}/model/modelitem.cpp (100%) rename {apps/launcher => components/file_order_list}/model/modelitem.hpp (100%) rename {apps/launcher => components/file_order_list}/utils/filedialog.cpp (100%) rename {apps/launcher => components/file_order_list}/utils/filedialog.hpp (100%) rename {apps/launcher => components/file_order_list}/utils/lineedit.cpp (100%) rename {apps/launcher => components/file_order_list}/utils/lineedit.hpp (100%) rename {apps/launcher => components/file_order_list}/utils/naturalsort.cpp (100%) rename {apps/launcher => components/file_order_list}/utils/naturalsort.hpp (100%) rename {apps/launcher => components/file_order_list}/utils/profilescombobox.cpp (100%) rename {apps/launcher => components/file_order_list}/utils/profilescombobox.hpp (100%) rename {apps/launcher => components/file_order_list}/utils/textinputdialog.cpp (100%) rename {apps/launcher => components/file_order_list}/utils/textinputdialog.hpp (100%) diff --git a/apps/launcher/CMakeLists.txt b/apps/launcher/CMakeLists.txt index 09beaf59d..73efb9ee5 100644 --- a/apps/launcher/CMakeLists.txt +++ b/apps/launcher/CMakeLists.txt @@ -1,56 +1,23 @@ set(LAUNCHER - datafilespage.cpp graphicspage.cpp main.cpp maindialog.cpp playpage.cpp - model/datafilesmodel.cpp - model/modelitem.cpp - model/esm/esmfile.cpp - - utils/filedialog.cpp - utils/naturalsort.cpp - utils/lineedit.cpp - utils/profilescombobox.cpp - utils/textinputdialog.cpp - launcher.rc ) set(LAUNCHER_HEADER - datafilespage.hpp graphicspage.hpp maindialog.hpp playpage.hpp - - model/datafilesmodel.hpp - model/modelitem.hpp - model/esm/esmfile.hpp - - utils/lineedit.hpp - utils/filedialog.hpp - utils/naturalsort.hpp - utils/profilescombobox.hpp - utils/textinputdialog.hpp - ) # Headers that must be pre-processed set(LAUNCHER_HEADER_MOC - datafilespage.hpp graphicspage.hpp maindialog.hpp playpage.hpp - - model/datafilesmodel.hpp - model/modelitem.hpp - model/esm/esmfile.hpp - - utils/lineedit.hpp - utils/filedialog.hpp - utils/profilescombobox.hpp - utils/textinputdialog.hpp ) source_group(launcher FILES ${LAUNCHER} ${LAUNCHER_HEADER} ${LAUNCHER_HEADER_MOC}) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 2c4f3430c..e69a8c207 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -8,8 +8,7 @@ #include #include #include - -#include "utils/naturalsort.hpp" +#include #include "graphicspage.hpp" diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 674ccdf67..7eb31e76b 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -1,9 +1,10 @@ #include +#include + #include "maindialog.hpp" #include "playpage.hpp" #include "graphicspage.hpp" -#include "datafilespage.hpp" MainDialog::MainDialog() { diff --git a/cmake/OpenMWMacros.cmake b/cmake/OpenMWMacros.cmake index e6f45fdb1..398363667 100644 --- a/cmake/OpenMWMacros.cmake +++ b/cmake/OpenMWMacros.cmake @@ -23,6 +23,22 @@ endforeach (u) source_group ("components\\${dir}" FILES ${files}) endmacro (add_component_dir) +macro (add_component_qt_dir dir) +set (files) +foreach (u ${ARGN}) +file (GLOB ALL ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.[ch]pp") +foreach (f ${ALL}) +list (APPEND files "${f}") +list (APPEND COMPONENT_FILES "${f}") +endforeach (f) +file (GLOB MOC_H ${CMAKE_CURRENT_SOURCE_DIR} "${dir}/${u}.hpp") +foreach (fi ${MOC_H}) +list (APPEND COMPONENT_MOC_FILES "${fi}") +endforeach (fi) +endforeach (u) +source_group ("components\\${dir}" FILES ${files}) +endmacro (add_component_qt_dir) + macro (copy_all_files source_dir destination_dir files) foreach (f ${files}) get_filename_component(filename ${f} NAME) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 3da09ecb8..a6812dbb3 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -66,9 +66,19 @@ add_component_dir (translation translation ) +add_component_qt_dir (file_order_list + datafilespage model/modelitem model/datafilesmodel model/esm/esmfile + utils/filedialog utils/lineedit utils/profilescombobox utils/textinputdialog utils/naturalsort + ) + +find_package(Qt4 COMPONENTS QtCore QtGUI REQUIRED) +include(${QT_USE_FILE}) + +QT4_WRAP_CPP(MOC_SRCS ${COMPONENT_MOC_FILES}) + include_directories(${BULLET_INCLUDE_DIRS}) -add_library(components STATIC ${COMPONENT_FILES}) +add_library(components STATIC ${COMPONENT_FILES} ${MOC_SRCS}) target_link_libraries(components ${Boost_LIBRARIES} ${OGRE_LIBRARIES}) diff --git a/apps/launcher/datafilespage.cpp b/components/file_order_list/datafilespage.cpp similarity index 100% rename from apps/launcher/datafilespage.cpp rename to components/file_order_list/datafilespage.cpp diff --git a/apps/launcher/datafilespage.hpp b/components/file_order_list/datafilespage.hpp similarity index 100% rename from apps/launcher/datafilespage.hpp rename to components/file_order_list/datafilespage.hpp diff --git a/apps/launcher/model/datafilesmodel.cpp b/components/file_order_list/model/datafilesmodel.cpp similarity index 100% rename from apps/launcher/model/datafilesmodel.cpp rename to components/file_order_list/model/datafilesmodel.cpp diff --git a/apps/launcher/model/datafilesmodel.hpp b/components/file_order_list/model/datafilesmodel.hpp similarity index 100% rename from apps/launcher/model/datafilesmodel.hpp rename to components/file_order_list/model/datafilesmodel.hpp diff --git a/apps/launcher/model/esm/esmfile.cpp b/components/file_order_list/model/esm/esmfile.cpp similarity index 100% rename from apps/launcher/model/esm/esmfile.cpp rename to components/file_order_list/model/esm/esmfile.cpp diff --git a/apps/launcher/model/esm/esmfile.hpp b/components/file_order_list/model/esm/esmfile.hpp similarity index 100% rename from apps/launcher/model/esm/esmfile.hpp rename to components/file_order_list/model/esm/esmfile.hpp diff --git a/apps/launcher/model/modelitem.cpp b/components/file_order_list/model/modelitem.cpp similarity index 100% rename from apps/launcher/model/modelitem.cpp rename to components/file_order_list/model/modelitem.cpp diff --git a/apps/launcher/model/modelitem.hpp b/components/file_order_list/model/modelitem.hpp similarity index 100% rename from apps/launcher/model/modelitem.hpp rename to components/file_order_list/model/modelitem.hpp diff --git a/apps/launcher/utils/filedialog.cpp b/components/file_order_list/utils/filedialog.cpp similarity index 100% rename from apps/launcher/utils/filedialog.cpp rename to components/file_order_list/utils/filedialog.cpp diff --git a/apps/launcher/utils/filedialog.hpp b/components/file_order_list/utils/filedialog.hpp similarity index 100% rename from apps/launcher/utils/filedialog.hpp rename to components/file_order_list/utils/filedialog.hpp diff --git a/apps/launcher/utils/lineedit.cpp b/components/file_order_list/utils/lineedit.cpp similarity index 100% rename from apps/launcher/utils/lineedit.cpp rename to components/file_order_list/utils/lineedit.cpp diff --git a/apps/launcher/utils/lineedit.hpp b/components/file_order_list/utils/lineedit.hpp similarity index 100% rename from apps/launcher/utils/lineedit.hpp rename to components/file_order_list/utils/lineedit.hpp diff --git a/apps/launcher/utils/naturalsort.cpp b/components/file_order_list/utils/naturalsort.cpp similarity index 100% rename from apps/launcher/utils/naturalsort.cpp rename to components/file_order_list/utils/naturalsort.cpp diff --git a/apps/launcher/utils/naturalsort.hpp b/components/file_order_list/utils/naturalsort.hpp similarity index 100% rename from apps/launcher/utils/naturalsort.hpp rename to components/file_order_list/utils/naturalsort.hpp diff --git a/apps/launcher/utils/profilescombobox.cpp b/components/file_order_list/utils/profilescombobox.cpp similarity index 100% rename from apps/launcher/utils/profilescombobox.cpp rename to components/file_order_list/utils/profilescombobox.cpp diff --git a/apps/launcher/utils/profilescombobox.hpp b/components/file_order_list/utils/profilescombobox.hpp similarity index 100% rename from apps/launcher/utils/profilescombobox.hpp rename to components/file_order_list/utils/profilescombobox.hpp diff --git a/apps/launcher/utils/textinputdialog.cpp b/components/file_order_list/utils/textinputdialog.cpp similarity index 100% rename from apps/launcher/utils/textinputdialog.cpp rename to components/file_order_list/utils/textinputdialog.cpp diff --git a/apps/launcher/utils/textinputdialog.hpp b/components/file_order_list/utils/textinputdialog.hpp similarity index 100% rename from apps/launcher/utils/textinputdialog.hpp rename to components/file_order_list/utils/textinputdialog.hpp