freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype-demos][gsoc-2022-chariri-3] [ftinspect] Support


From: Charlie Jiang (@cqjjjzr)
Subject: [Git][freetype/freetype-demos][gsoc-2022-chariri-3] [ftinspect] Support open files via command line.
Date: Tue, 02 Aug 2022 17:11:10 +0000

Charlie Jiang pushed to branch gsoc-2022-chariri-3 at FreeType / FreeType Demo Programs

Commits:

  • d357f26c
    by Charlie Jiang at 2022-08-03T01:10:10+08:00
    [ftinspect] Support open files via command line.
    
    * src/ftinspect/engine/fontfilemanager.cpp,
      src/ftinspect/engine/fontfilemanager.hpp:
      Add `loadFromCommandLine` function.
    
    * src/ftinspect/maingui.cpp, src/ftinspect/maingui.hpp:
      Call `FontFileManager::loadFromCommandLine` when starting up.
    

4 changed files:

Changes:

  • src/ftinspect/engine/fontfilemanager.cpp
    ... ... @@ -5,6 +5,9 @@
    5 5
     
    
    6 6
     #include "fontfilemanager.hpp"
    
    7 7
     
    
    8
    +#include <QCoreApplication>
    
    9
    +
    
    10
    +
    
    8 11
     FontFileManager::FontFileManager()
    
    9 12
     {
    
    10 13
       fontWatcher_ = new QFileSystemWatcher(this);
    
    ... ... @@ -100,6 +103,18 @@ FontFileManager::timerStart()
    100 103
     }
    
    101 104
     
    
    102 105
     
    
    106
    +void
    
    107
    +FontFileManager::loadFromCommandLine()
    
    108
    +{
    
    109
    +  // TODO: To support more complicated command line, we need to move this away
    
    110
    +  // and use `QCommandLineParser`
    
    111
    +  auto args = QCoreApplication::arguments();
    
    112
    +  if (!args.empty())
    
    113
    +    args.removeFirst();
    
    114
    +  append(args);
    
    115
    +}
    
    116
    +
    
    117
    +
    
    103 118
     void
    
    104 119
     FontFileManager::onTimerOrWatcherFire()
    
    105 120
     {
    

  • src/ftinspect/engine/fontfilemanager.hpp
    ... ... @@ -29,6 +29,7 @@ public:
    29 29
       QFileInfo& operator[](int index);
    
    30 30
       void updateWatching(int index);
    
    31 31
       void timerStart();
    
    32
    +  void loadFromCommandLine();
    
    32 33
     
    
    33 34
     signals:
    
    34 35
       void currentFileChanged();
    

  • src/ftinspect/maingui.cpp
    ... ... @@ -28,6 +28,7 @@ MainGUI::MainGUI(Engine* engine)
    28 28
       setupDragDrop();
    
    29 29
     
    
    30 30
       readSettings();
    
    31
    +  loadCommandLine();
    
    31 32
     
    
    32 33
       setUnifiedTitleAndToolBarOnMac(true);
    
    33 34
     }
    
    ... ... @@ -142,6 +143,14 @@ MainGUI::openFonts(QStringList const& fileNames)
    142 143
     }
    
    143 144
     
    
    144 145
     
    
    146
    +void
    
    147
    +MainGUI::loadCommandLine()
    
    148
    +{
    
    149
    +  engine_->fontFileManager().loadFromCommandLine();
    
    150
    +  tripletSelector_->repopulateFonts();
    
    151
    +}
    
    152
    +
    
    153
    +
    
    145 154
     void
    
    146 155
     MainGUI::onTripletChanged()
    
    147 156
     {
    

  • src/ftinspect/maingui.hpp
    ... ... @@ -125,6 +125,8 @@ private:
    125 125
     
    
    126 126
       void readSettings();
    
    127 127
       void writeSettings();
    
    128
    +
    
    129
    +  void loadCommandLine();
    
    128 130
     };
    
    129 131
     
    
    130 132
     
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]