Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: xiaoming <[email protected]>
  • Loading branch information
QQxiaoming committed Oct 27, 2023
1 parent 0d5acb7 commit 1c43f62
Show file tree
Hide file tree
Showing 84 changed files with 26,586 additions and 8,129 deletions.
420 changes: 213 additions & 207 deletions quard_star_tools/lang/quard_star_tools_en_US.ts

Large diffs are not rendered by default.

420 changes: 213 additions & 207 deletions quard_star_tools/lang/quard_star_tools_ja_JP.ts

Large diffs are not rendered by default.

420 changes: 213 additions & 207 deletions quard_star_tools/lang/quard_star_tools_zh_CN.ts

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions quard_star_tools/lib/qtermwidget/BlockArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ BlockArray::BlockArray()
blocksize = ((sizeof(Block) / getpagesize()) + 1) * getpagesize();
#endif
}

}

BlockArray::~BlockArray()
Expand Down Expand Up @@ -152,7 +151,6 @@ const Block * BlockArray::at(size_t i)
}

// if (index - i >= length) {
// kDebug(1211) << "BlockArray::at() index - i >= length\n";
// return 0;
// }

Expand Down Expand Up @@ -202,8 +200,6 @@ bool BlockArray::setSize(size_t newsize)

bool BlockArray::setHistorySize(size_t newsize)
{
// kDebug(1211) << "setHistorySize " << size << " " << newsize;

if (size == newsize) {
return false;
}
Expand Down Expand Up @@ -325,7 +321,6 @@ void BlockArray::decreaseBuffer(size_t newsize)
delete [] buffer1;

fclose(fion);

}

void BlockArray::increaseBuffer()
Expand Down Expand Up @@ -393,6 +388,5 @@ void BlockArray::increaseBuffer()
delete [] buffer2;

fclose(fion);

}

10 changes: 3 additions & 7 deletions quard_star_tools/lib/qtermwidget/BlockArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,13 @@
//#error Do not use in KDE 2.1

#define QTERMWIDGET_BLOCKSIZE (1 << 12)
#define ENTRIES ((QTERMWIDGET_BLOCKSIZE - sizeof(size_t) ) / sizeof(unsigned char))
#define ENTRIES (QTERMWIDGET_BLOCKSIZE - sizeof(size_t))

namespace Konsole {

struct Block {
Block() {
size = 0;
}
unsigned char data[ENTRIES];
size_t size;
unsigned char data[ENTRIES] = {};
size_t size = 0;
};

// ///////////////////////////////////////////////////////
Expand Down Expand Up @@ -122,7 +119,6 @@ class BlockArray {

int ion;
size_t length;

};

}
Expand Down
5 changes: 1 addition & 4 deletions quard_star_tools/lib/qtermwidget/CharacterColor.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
// Qt
#include <QColor>

//#include <kdemacros.h>
#define KDE_NO_EXPORT

namespace Konsole
{

Expand Down Expand Up @@ -108,7 +105,7 @@ class ColorEntry
//a standard set of colors using black text on a white background.
//defined in TerminalDisplay.cpp

extern const ColorEntry base_color_table[TABLE_COLORS] KDE_NO_EXPORT;
extern const ColorEntry base_color_table[TABLE_COLORS];

/* CharacterColor is a union of the various color spaces.
Expand Down
28 changes: 3 additions & 25 deletions quard_star_tools/lib/qtermwidget/ColorScheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@
#include <QRandomGenerator>
#include <QStringView>

// KDE
//#include <KColorScheme>
//#include <KConfig>
//#include <KLocale>
//#include <KDebug>
//#include <KConfigGroup>
//#include <KStandardDirs>

using namespace Konsole;

const ColorEntry ColorScheme::defaultTable[TABLE_COLORS] =
Expand Down Expand Up @@ -417,9 +409,9 @@ void ColorScheme::writeColorEntry(KConfig& config , const QString& colorName, co
// if one of the keys already exists
if ( !random.isNull() || configGroup.hasKey("MaxRandomHue") )
{
configGroup.writeEntry("MaxRandomHue",(int)random.hue);
configGroup.writeEntry("MaxRandomValue",(int)random.value);
configGroup.writeEntry("MaxRandomSaturation",(int)random.saturation);
configGroup.writeEntry("MaxRandomHue",static_cast<int>(random.hue));
configGroup.writeEntry("MaxRandomValue",static_cast<int>(random.value));
configGroup.writeEntry("MaxRandomSaturation",static_cast<int>(random.saturation));
}
}
#endif
Expand Down Expand Up @@ -521,18 +513,6 @@ QList<const ColorScheme*> ColorSchemeManager::allColorSchemes()

return _colorSchemes.values();
}
#if 0
void ColorSchemeManager::addColorScheme(ColorScheme* scheme)
{
_colorSchemes.insert(scheme->name(),scheme);

// save changes to disk
QString path = KGlobal::dirs()->saveLocation("data","konsole/") + scheme->name() + ".colorscheme";
KConfig config(path , KConfig::NoGlobals);

scheme->write(config);
}
#endif

bool ColorSchemeManager::loadCustomColorScheme(const QString& path)
{
Expand Down Expand Up @@ -619,7 +599,6 @@ bool ColorSchemeManager::deleteColorScheme(const QString& name)
}
QString ColorSchemeManager::findColorSchemePath(const QString& name) const
{
// QString path = KStandardDirs::locate("data","konsole/"+name+".colorscheme");
const QStringList dirs = get_color_schemes_dirs();
if ( dirs.isEmpty() )
return QString();
Expand All @@ -629,7 +608,6 @@ QString ColorSchemeManager::findColorSchemePath(const QString& name) const
if ( !path.isEmpty() )
return path;

//path = KStandardDirs::locate("data","konsole/"+name+".schema");
path = dir + QLatin1Char('/')+ name + QLatin1String(".schema");

return path;
Expand Down
12 changes: 2 additions & 10 deletions quard_star_tools/lib/qtermwidget/ColorScheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ class ColorScheme
static const char* const translatedColorNames[TABLE_COLORS];

static const ColorEntry defaultTable[]; // table of default color entries

ColorScheme& operator=(const ColorScheme&) = delete;
};

/**
Expand All @@ -224,7 +226,6 @@ class AccessibleColorScheme : public ColorScheme
class ColorSchemeManager
{
public:

/**
* Constructs a new ColorSchemeManager and loads the list
* of available color schemes.
Expand Down Expand Up @@ -253,15 +254,6 @@ class ColorSchemeManager
*/
const ColorScheme* findColorScheme(const QString& name);

#if 0
/**
* Adds a new color scheme to the manager. If @p scheme has the same name as
* an existing color scheme, it replaces the existing scheme.
*
* TODO - Ensure the old color scheme gets deleted
*/
void addColorScheme(ColorScheme* scheme);
#endif
/**
* Deletes a color scheme. Returns true on successful deletion or false otherwise.
*/
Expand Down
3 changes: 2 additions & 1 deletion quard_star_tools/lib/qtermwidget/ColorTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

#include "CharacterColor.h"

//using namespace Konsole;
#if 0
using namespace Konsole;

static const ColorEntry whiteonblack_color_table[TABLE_COLORS] = {
// normal
ColorEntry(QColor(0xFF,0xFF,0xFF), false ), ColorEntry( QColor(0x00,0x00,0x00), true ), // Dfore, Dback
Expand Down
10 changes: 1 addition & 9 deletions quard_star_tools/lib/qtermwidget/Emulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,21 @@
02110-1301 USA.
*/

// Own
#include "Emulation.h"

// System
#include <cstdio>
#include <cstdlib>
#include <unistd.h>
#include <string>

// Qt
#include <QApplication>
#include <QClipboard>
#include <QHash>
#include <QKeyEvent>
#include <QTextStream>
#include <QThread>

#include <QTime>

// KDE
//#include <kdebug.h>

// Konsole
#include "KeyboardTranslator.h"
#include "Screen.h"
#include "TerminalCharacterDecoder.h"
Expand Down Expand Up @@ -138,7 +130,7 @@ void Emulation::setScreen(int n)
if (_currentScreen != old)
{
// tell all windows onto this emulation to switch to the newly active screen
for(ScreenWindow* window : qAsConst(_windows))
for(ScreenWindow* window : std::as_const(_windows))
window->setScreen(_currentScreen);
}
}
Expand Down
4 changes: 1 addition & 3 deletions quard_star_tools/lib/qtermwidget/Emulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <QTextStream>
#include <QTimer>

#include "qtermwidget_export.h"
#include "KeyboardTranslator.h"

namespace Konsole
Expand Down Expand Up @@ -118,12 +117,11 @@ enum
* how long the emulation has been active/idle for and also respond to
* a 'bell' event in different ways.
*/
class QTERMWIDGET_EXPORT Emulation : public QObject
class Emulation : public QObject
{
Q_OBJECT

public:

/**
* This enum describes the available shapes for the keyboard cursor.
* See setKeyboardCursorShape()
Expand Down
7 changes: 1 addition & 6 deletions quard_star_tools/lib/qtermwidget/Filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,8 @@
#include <QDesktopServices>
#include <QUrl>

// KDE
//#include <KLocale>
//#include <KRun>

// Konsole
#include "TerminalCharacterDecoder.h"
#include "konsole_wcwidth.h"
#include "console_charwidth.h"

using namespace Konsole;

Expand Down
20 changes: 9 additions & 11 deletions quard_star_tools/lib/qtermwidget/Filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
#include <QHash>
#include <QRegExp>

// Local
#include "qtermwidget_export.h"

namespace Konsole
{

Expand All @@ -55,7 +52,7 @@ class Character;
* When processing the text they should create instances of Filter::HotSpot subclasses for sections of interest
* and add them to the filter's list of hotspots using addHotSpot()
*/
class QTERMWIDGET_EXPORT Filter : public QObject
class Filter : public QObject
{
public:
/**
Expand Down Expand Up @@ -128,7 +125,6 @@ class QTERMWIDGET_EXPORT Filter : public QObject
int _endLine;
int _endColumn;
Type _type;

};

/** Constructs a new filter. */
Expand Down Expand Up @@ -184,7 +180,7 @@ class QTERMWIDGET_EXPORT Filter : public QObject
* Subclasses can reimplement newHotSpot() to return custom hotspot types when matches for the regular expression
* are found.
*/
class QTERMWIDGET_EXPORT RegExpFilter : public Filter
class RegExpFilter : public Filter
{
public:
/**
Expand Down Expand Up @@ -241,7 +237,7 @@ class QTERMWIDGET_EXPORT RegExpFilter : public Filter
class FilterObject;

/** A filter which matches URLs in blocks of text */
class QTERMWIDGET_EXPORT UrlFilter : public RegExpFilter
class UrlFilter : public RegExpFilter
{
Q_OBJECT
public:
Expand Down Expand Up @@ -275,6 +271,9 @@ class QTERMWIDGET_EXPORT UrlFilter : public RegExpFilter
UrlType urlType() const;

FilterObject* _urlObject;

HotSpot( const HotSpot& ) = delete;
HotSpot& operator= ( const HotSpot& ) = delete;
};

UrlFilter();
Expand All @@ -283,17 +282,17 @@ class QTERMWIDGET_EXPORT UrlFilter : public RegExpFilter
RegExpFilter::HotSpot* newHotSpot(int,int,int,int) override;

private:

static const QRegExp FullUrlRegExp;
static const QRegExp EmailAddressRegExp;

// combined OR of FullUrlRegExp and EmailAddressRegExp
static const QRegExp CompleteUrlRegExp;

signals:
void activated(const QUrl& url, bool fromContextMenu);
};

class QTERMWIDGET_NO_EXPORT FilterObject : public QObject
class FilterObject : public QObject
{
Q_OBJECT
public:
Expand Down Expand Up @@ -325,7 +324,7 @@ public slots:
* The hotSpots() and hotSpotsAtLine() method return all of the hotspots in the text and on
* a given line respectively.
*/
class QTERMWIDGET_EXPORT FilterChain : protected QList<Filter*>
class FilterChain : protected QList<Filter*>
{
public:
virtual ~FilterChain();
Expand Down Expand Up @@ -355,7 +354,6 @@ class QTERMWIDGET_EXPORT FilterChain : protected QList<Filter*>
QList<Filter::HotSpot*> hotSpots() const;
/** Returns a list of all hotspots at the given line in all the chain's filters */
QList<Filter::HotSpot> hotSpotsAtLine(int line) const;

};

/** A filter chain which processes character images from terminal displays */
Expand Down
Loading

0 comments on commit 1c43f62

Please sign in to comment.