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] [ftinspect] Remove `sy


From: Charlie Jiang (@cqjjjzr)
Subject: [Git][freetype/freetype-demos][gsoc-2022-chariri] [ftinspect] Remove `syncSettings` and `setDefaults` from `AbstractTab`.
Date: Sun, 10 Jul 2022 07:18:31 +0000

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

Commits:

  • 0148c2f6
    by Charlie Jiang at 2022-07-10T15:15:06+08:00
    [ftinspect] Remove `syncSettings` and `setDefaults` from `AbstractTab`.
    
    It's unnecessary to call `syncSettings` and `setDefaults` from `MainGUI`.
    The tabs themselves are responsible for managing these.
    
    * src/ftinspect/maingui.cpp: Remove invocation of `syncSettings` and
      `setDefaults`
    
    * src/ftinspect/panels/abstracttab.hpp: As described.
    
    * src/ftinspect/panels/continuous.cpp, src/ftinspect/panels/continuous.hpp:
      Remove the two functions.
    
    * src/ftinspect/panels/singular.cpp, src/ftinspect/panels/singular.cpp:
      Make the two functions not `override` and `private`.
    

6 changed files:

Changes:

  • src/ftinspect/maingui.cpp
    ... ... @@ -255,7 +255,6 @@ void
    255 255
     MainGUI::syncSettings()
    
    256 256
     {
    
    257 257
       settingPanel_->syncSettings();
    
    258
    -  tabs_[tabWidget_->currentIndex()]->syncSettings();
    
    259 258
     }
    
    260 259
     
    
    261 260
     
    
    ... ... @@ -588,9 +587,7 @@ MainGUI::setDefaults()
    588 587
       currentFontIndex_ = 0;
    
    589 588
       currentFaceIndex_ = 0;
    
    590 589
       currentNamedInstanceIndex_ = 0;
    
    591
    -
    
    592
    -  for (auto tab : tabs_)
    
    593
    -    tab->setDefaults();
    
    590
    +  
    
    594 591
       checkCurrentFontIndex();
    
    595 592
       checkCurrentFaceIndex();
    
    596 593
       checkCurrentNamedInstanceIndex();
    

  • src/ftinspect/panels/abstracttab.hpp
    ... ... @@ -11,9 +11,7 @@ class AbstractTab
    11 11
     {
    
    12 12
     public:
    
    13 13
       virtual ~AbstractTab() = default; // must be `virtual` for `dynamic_cast`
    
    14
    -
    
    15
    -  virtual void syncSettings() = 0;
    
    16
    -  virtual void setDefaults() = 0;
    
    14
    +  
    
    17 15
       virtual void repaintGlyph() = 0;
    
    18 16
       virtual void reloadFont() = 0;
    
    19 17
     };
    

  • src/ftinspect/panels/continuous.cpp
    ... ... @@ -36,12 +36,6 @@ ContinuousTab::reloadFont()
    36 36
     }
    
    37 37
     
    
    38 38
     
    
    39
    -void
    
    40
    -ContinuousTab::syncSettings()
    
    41
    -{
    
    42
    -}
    
    43
    -
    
    44
    -
    
    45 39
     void
    
    46 40
     ContinuousTab::changeTab()
    
    47 41
     {
    
    ... ... @@ -108,12 +102,6 @@ ContinuousTab::createConnections()
    108 102
     }
    
    109 103
     
    
    110 104
     
    
    111
    -void
    
    112
    -ContinuousTab::setDefaults()
    
    113
    -{
    
    114
    -}
    
    115
    -
    
    116
    -
    
    117 105
     void
    
    118 106
     ContinuousTab::updateCurrentSubTab()
    
    119 107
     {
    

  • src/ftinspect/panels/continuous.hpp
    ... ... @@ -31,8 +31,6 @@ public:
    31 31
     
    
    32 32
       void repaintGlyph() override;
    
    33 33
       void reloadFont() override;
    
    34
    -  void syncSettings() override;
    
    35
    -  void setDefaults() override;
    
    36 34
     
    
    37 35
       // Info about current font (glyph count, charmaps...) is flowed to subtab
    
    38 36
       // via `updateCurrentSubTab`.
    

  • src/ftinspect/panels/singular.cpp
    ... ... @@ -16,6 +16,7 @@ SingularTab::SingularTab(QWidget* parent, Engine* engine)
    16 16
       createConnections();
    
    17 17
     
    
    18 18
       currentGlyphIndex_ = 0;
    
    19
    +  setDefaults();
    
    19 20
       checkShowPoints();
    
    20 21
     }
    
    21 22
     
    

  • src/ftinspect/panels/singular.hpp
    ... ... @@ -41,8 +41,6 @@ public:
    41 41
     
    
    42 42
       void repaintGlyph() override;
    
    43 43
       void reloadFont() override;
    
    44
    -  void syncSettings() override;
    
    45
    -  void setDefaults() override;
    
    46 44
     
    
    47 45
     private slots:
    
    48 46
       void setGlyphIndex(int);
    
    ... ... @@ -97,6 +95,8 @@ private:
    97 95
       void createConnections();
    
    98 96
       
    
    99 97
       void updateGrid();
    
    98
    +  void syncSettings();
    
    99
    +  void setDefaults();
    
    100 100
     };
    
    101 101
     
    
    102 102
     // end of singular.hpp


  • reply via email to

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