mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-24 05:45:27 +00:00
parent
837dd63e6b
commit
76773eadd6
@ -196,8 +196,8 @@ QJsonDocument ColorThemeWorker::getTheme(const QString& themeName) const
|
|||||||
return QJsonDocument();
|
return QJsonDocument();
|
||||||
}
|
}
|
||||||
QStringList sl;
|
QStringList sl;
|
||||||
for (auto &line : QString(src.readAll()).split('\n', QString::SkipEmptyParts)) {
|
for (auto &line : QString(src.readAll()).split('\n', CUTTER_QT_SKIP_EMPTY_PARTS)) {
|
||||||
sl = line.replace("#~", "ec ").replace("rgb:", "#").split(' ', QString::SkipEmptyParts);
|
sl = line.replace("#~", "ec ").replace("rgb:", "#").split(' ', CUTTER_QT_SKIP_EMPTY_PARTS);
|
||||||
if (sl.size() != 3 || sl[0][0] == '#') {
|
if (sl.size() != 3 || sl[0][0] == '#') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -320,7 +320,7 @@ bool ColorThemeWorker::isFileTheme(const QString& filePath, bool* ok) const
|
|||||||
// The below construct mimics the behaviour of QRegexP::exactMatch(), which was here before
|
// The below construct mimics the behaviour of QRegexP::exactMatch(), which was here before
|
||||||
QRegularExpression regexp("\\A(?:" + pattern + ")\\z");
|
QRegularExpression regexp("\\A(?:" + pattern + ")\\z");
|
||||||
|
|
||||||
for (auto &line : QString(f.readAll()).split('\n', QString::SkipEmptyParts)) {
|
for (auto &line : QString(f.readAll()).split('\n', CUTTER_QT_SKIP_EMPTY_PARTS)) {
|
||||||
line.replace("#~", "ec ");
|
line.replace("#~", "ec ");
|
||||||
if (!line.isEmpty() && !regexp.match(line).hasMatch()) {
|
if (!line.isEmpty() && !regexp.match(line).hasMatch()) {
|
||||||
*ok = true;
|
*ok = true;
|
||||||
|
@ -665,7 +665,7 @@ QStringList Configuration::getAvailableTranslations()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList fileNames = fileNamesSet.toList();
|
QStringList fileNames = fileNamesSet.values();
|
||||||
std::sort(fileNames.begin(), fileNames.end());
|
std::sort(fileNames.begin(), fileNames.end());
|
||||||
QStringList languages;
|
QStringList languages;
|
||||||
QString currLanguageName;
|
QString currLanguageName;
|
||||||
|
@ -21,6 +21,12 @@ class QMenu;
|
|||||||
class QPaintDevice;
|
class QPaintDevice;
|
||||||
class QComboBox;
|
class QComboBox;
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||||
|
#define CUTTER_QT_SKIP_EMPTY_PARTS QString::SkipEmptyParts
|
||||||
|
#else
|
||||||
|
#define CUTTER_QT_SKIP_EMPTY_PARTS Qt::SkipEmptyParts
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace qhelpers {
|
namespace qhelpers {
|
||||||
QString formatBytecount(const uint64_t bytecount);
|
QString formatBytecount(const uint64_t bytecount);
|
||||||
void adjustColumns(QTreeView *tv, int columnCount, int padding);
|
void adjustColumns(QTreeView *tv, int columnCount, int padding);
|
||||||
|
@ -606,9 +606,6 @@ bool CutterCore::loadFile(QString path, ut64 baddr, ut64 mapaddr, int perms, int
|
|||||||
r_core_cmd0 (core, "omfg+w");
|
r_core_cmd0 (core, "omfg+w");
|
||||||
}
|
}
|
||||||
|
|
||||||
ut64 hashLimit = getConfigut64("cfg.hashlimit");
|
|
||||||
r_bin_file_compute_hashes(core->bin, hashLimit);
|
|
||||||
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -999,7 +996,7 @@ QString CutterCore::getConfigDescription(const char *k)
|
|||||||
{
|
{
|
||||||
CORE_LOCK();
|
CORE_LOCK();
|
||||||
RConfigNode *node = r_config_node_get (core->config, k);
|
RConfigNode *node = r_config_node_get (core->config, k);
|
||||||
return QString(node->desc);
|
return node ? QString(node->desc) : QString("Unrecognized configuration key");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CutterCore::triggerRefreshAll()
|
void CutterCore::triggerRefreshAll()
|
||||||
|
@ -26,6 +26,7 @@ class R2TaskDialog;
|
|||||||
#include "plugins/CutterPlugin.h"
|
#include "plugins/CutterPlugin.h"
|
||||||
#include "common/BasicBlockHighlighter.h"
|
#include "common/BasicBlockHighlighter.h"
|
||||||
#include "common/R2Task.h"
|
#include "common/R2Task.h"
|
||||||
|
#include "common/Helpers.h"
|
||||||
#include "dialogs/R2TaskDialog.h"
|
#include "dialogs/R2TaskDialog.h"
|
||||||
|
|
||||||
#define Core() (CutterCore::instance())
|
#define Core() (CutterCore::instance())
|
||||||
@ -108,7 +109,7 @@ public:
|
|||||||
|
|
||||||
QJsonDocument cmdj(const char *str);
|
QJsonDocument cmdj(const char *str);
|
||||||
QJsonDocument cmdj(const QString &str) { return cmdj(str.toUtf8().constData()); }
|
QJsonDocument cmdj(const QString &str) { return cmdj(str.toUtf8().constData()); }
|
||||||
QStringList cmdList(const char *str) { return cmd(str).split(QLatin1Char('\n'), QString::SkipEmptyParts); }
|
QStringList cmdList(const char *str) { return cmd(str).split(QLatin1Char('\n'), CUTTER_QT_SKIP_EMPTY_PARTS); }
|
||||||
QStringList cmdList(const QString &str) { return cmdList(str.toUtf8().constData()); }
|
QStringList cmdList(const QString &str) { return cmdList(str.toUtf8().constData()); }
|
||||||
QString cmdTask(const QString &str);
|
QString cmdTask(const QString &str);
|
||||||
QJsonDocument cmdjTask(const QString &str);
|
QJsonDocument cmdjTask(const QString &str);
|
||||||
|
@ -226,7 +226,7 @@ QVariant XrefModel::data(const QModelIndex &index, int role) const
|
|||||||
case FlagDescriptionRole:
|
case FlagDescriptionRole:
|
||||||
return QVariant::fromValue(xref);
|
return QVariant::fromValue(xref);
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
break;
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
@ -56,9 +56,9 @@ DisassemblyContextMenu::DisassemblyContextMenu(QWidget *parent, MainWindow *main
|
|||||||
actionSetBits32(this),
|
actionSetBits32(this),
|
||||||
actionSetBits64(this),
|
actionSetBits64(this),
|
||||||
actionContinueUntil(this),
|
actionContinueUntil(this),
|
||||||
|
actionSetPC(this),
|
||||||
actionAddBreakpoint(this),
|
actionAddBreakpoint(this),
|
||||||
actionAdvancedBreakpoint(this),
|
actionAdvancedBreakpoint(this),
|
||||||
actionSetPC(this),
|
|
||||||
actionSetToCode(this),
|
actionSetToCode(this),
|
||||||
actionSetAsStringAuto(this),
|
actionSetAsStringAuto(this),
|
||||||
actionSetAsStringRemove(this),
|
actionSetAsStringRemove(this),
|
||||||
@ -1003,9 +1003,7 @@ void DisassemblyContextMenu::on_actionEditFunction_triggered()
|
|||||||
QString startAddrText = "0x" + QString::number(fcn->addr, 16);
|
QString startAddrText = "0x" + QString::number(fcn->addr, 16);
|
||||||
dialog.setStartAddrText(startAddrText);
|
dialog.setStartAddrText(startAddrText);
|
||||||
|
|
||||||
QString stackSizeText;
|
dialog.setStackSizeText(QString::number(fcn->stack));
|
||||||
stackSizeText.sprintf("%d", fcn->stack);
|
|
||||||
dialog.setStackSizeText(stackSizeText);
|
|
||||||
|
|
||||||
QStringList callConList = Core()->cmdRaw("afcl").split("\n");
|
QStringList callConList = Core()->cmdRaw("afcl").split("\n");
|
||||||
callConList.removeLast();
|
callConList.removeLast();
|
||||||
|
@ -118,7 +118,7 @@ QVector<QDir> PluginManager::getPluginDirectories() const
|
|||||||
QChar listSeparator = QDir::listSeparator();
|
QChar listSeparator = QDir::listSeparator();
|
||||||
#endif
|
#endif
|
||||||
QString extra_plugin_dirs = CUTTER_EXTRA_PLUGIN_DIRS;
|
QString extra_plugin_dirs = CUTTER_EXTRA_PLUGIN_DIRS;
|
||||||
for (auto& path : extra_plugin_dirs.split(listSeparator, QString::SplitBehavior::SkipEmptyParts)) {
|
for (auto& path : extra_plugin_dirs.split(listSeparator, CUTTER_QT_SKIP_EMPTY_PARTS)) {
|
||||||
result.push_back(QDir(path));
|
result.push_back(QDir(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,19 +102,18 @@ private:
|
|||||||
QCompleter *completer;
|
QCompleter *completer;
|
||||||
QShortcut *historyUpShortcut;
|
QShortcut *historyUpShortcut;
|
||||||
QShortcut *historyDownShortcut;
|
QShortcut *historyDownShortcut;
|
||||||
FILE *origStderr;
|
FILE *origStderr = nullptr;
|
||||||
FILE *origStdout;
|
FILE *origStdout = nullptr;
|
||||||
FILE *origStdin;
|
FILE *origStdin = nullptr;
|
||||||
QLocalSocket *pipeSocket;
|
QLocalSocket *pipeSocket = nullptr;
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
HANDLE hRead;
|
HANDLE hRead;
|
||||||
HANDLE hWrite;
|
HANDLE hWrite;
|
||||||
#else
|
#else
|
||||||
int redirectPipeFds[2];
|
int redirectPipeFds[2];
|
||||||
int stdinFile;
|
int stdinFile = -1;
|
||||||
QString stdinFifoPath;
|
QString stdinFifoPath;
|
||||||
QVector<char> *redirectionBuffer;
|
QVector<char> *redirectionBuffer;
|
||||||
QSocketNotifier *outputNotifier;
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1241,7 +1241,11 @@ void DisassemblerGraphView::wheelEvent(QWheelEvent *event)
|
|||||||
if (!numDegrees.isNull()) {
|
if (!numDegrees.isNull()) {
|
||||||
int numSteps = numDegrees.y() / 15;
|
int numSteps = numDegrees.y() / 15;
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||||
QPointF relativeMousePos = event->pos();
|
QPointF relativeMousePos = event->pos();
|
||||||
|
#else
|
||||||
|
QPointF relativeMousePos = event->position();
|
||||||
|
#endif
|
||||||
relativeMousePos.rx() /= size().width();
|
relativeMousePos.rx() /= size().width();
|
||||||
relativeMousePos.ry() /= size().height();
|
relativeMousePos.ry() /= size().height();
|
||||||
|
|
||||||
|
@ -528,10 +528,9 @@ void HexWidget::mouseReleaseEvent(QMouseEvent *event)
|
|||||||
|
|
||||||
void HexWidget::wheelEvent(QWheelEvent *event)
|
void HexWidget::wheelEvent(QWheelEvent *event)
|
||||||
{
|
{
|
||||||
int dy = event->delta();
|
// according to Qt doc 1 row per 5 degrees, angle measured in 1/8 of degree
|
||||||
int64_t delta = 3 * itemRowByteLen();
|
int dy = event->angleDelta().y() / (8 * 5);
|
||||||
if (dy > 0)
|
int64_t delta = -dy * itemRowByteLen();
|
||||||
delta = -delta;
|
|
||||||
|
|
||||||
if (dy == 0)
|
if (dy == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -41,7 +41,7 @@ protected:
|
|||||||
|
|
||||||
std::unique_ptr<Ui::ListDockWidget> ui;
|
std::unique_ptr<Ui::ListDockWidget> ui;
|
||||||
private:
|
private:
|
||||||
AddressableFilterProxyModel *objectFilterProxyModel;
|
AddressableFilterProxyModel *objectFilterProxyModel = nullptr;
|
||||||
CutterTreeWidget *tree;
|
CutterTreeWidget *tree;
|
||||||
SearchBarPolicy searchBarPolicy;
|
SearchBarPolicy searchBarPolicy;
|
||||||
};
|
};
|
||||||
|
@ -41,7 +41,6 @@ class ResourcesWidget : public ListDockWidget
|
|||||||
private:
|
private:
|
||||||
ResourcesModel *model;
|
ResourcesModel *model;
|
||||||
AddressableFilterProxyModel *filterModel;
|
AddressableFilterProxyModel *filterModel;
|
||||||
CutterTreeView *view;
|
|
||||||
QList<ResourcesDescription> resources;
|
QList<ResourcesDescription> resources;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -58,7 +58,7 @@ VisualNavbar::VisualNavbar(MainWindow *main, QWidget *parent) :
|
|||||||
this->graphicsView->setMinimumHeight(15);
|
this->graphicsView->setMinimumHeight(15);
|
||||||
this->graphicsView->setMaximumHeight(15);
|
this->graphicsView->setMaximumHeight(15);
|
||||||
this->graphicsView->setFrameShape(QFrame::NoFrame);
|
this->graphicsView->setFrameShape(QFrame::NoFrame);
|
||||||
this->graphicsView->setRenderHints(0);
|
this->graphicsView->setRenderHints({});
|
||||||
this->graphicsView->setScene(graphicsScene);
|
this->graphicsView->setScene(graphicsScene);
|
||||||
this->graphicsView->setRenderHints(QPainter::Antialiasing);
|
this->graphicsView->setRenderHints(QPainter::Antialiasing);
|
||||||
this->graphicsView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
this->graphicsView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
Loading…
Reference in New Issue
Block a user