Skip to content

Commit 32480f7

Browse files
committed
minor fixes
1 parent e43762e commit 32480f7

File tree

4 files changed

+30
-35
lines changed

4 files changed

+30
-35
lines changed

src/editexecutablesdialog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
2121
#include "ui_editexecutablesdialog.h"
2222
#include "filedialogmemory.h"
2323
#include "stackdata.h"
24+
#include "modlist.h"
2425
#include <QMessageBox>
2526
#include <Shellapi.h>
2627
#include <utility.h>

src/mainwindow.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,11 +2978,7 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos)
29782978

29792979
if (info->getNexusID() > 0) {
29802980
menu->addAction(tr("Visit on Nexus"), this, SLOT(visitOnNexus_clicked()));
2981-
}
2982-
2983-
//If a URL is specified which is not the game's URL, pop up 'visit web page'
2984-
if (info->getURL() != "" &&
2985-
!NexusInterface::instance()->isModURL(info->getNexusID(), info->getURL())) {
2981+
} else if ((info->getURL() != "")) {
29862982
menu->addAction(tr("Visit web page"), this, SLOT(visitWebPage_clicked()));
29872983
}
29882984

@@ -3025,7 +3021,7 @@ void MainWindow::on_categoriesList_itemSelectionChanged()
30253021

30263022
m_ModListSortProxy->setCategoryFilter(categories);
30273023
m_ModListSortProxy->setContentFilter(content);
3028-
ui->clickBlankLabel->setEnabled(categories.size() > 0);
3024+
ui->clickBlankButton->setEnabled(categories.size() > 0);
30293025
if (indices.count() == 0) {
30303026
ui->currentCategoryLabel->setText(QString("(%1)").arg(tr("<All>")));
30313027
} else if (indices.count() > 1) {
@@ -4579,3 +4575,8 @@ void MainWindow::dropEvent(QDropEvent *event)
45794575
event->accept();
45804576
}
45814577

4578+
4579+
void MainWindow::on_clickBlankButton_clicked()
4580+
{
4581+
deselectFilters();
4582+
}

src/mainwindow.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ public slots:
183183
virtual void dragEnterEvent(QDragEnterEvent *event);
184184
virtual void dropEvent(QDropEvent *event);
185185

186+
private slots:
187+
void on_clickBlankButton_clicked();
188+
186189
private:
187190

188191
void cleanup();

src/usvfsconnector.cpp

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,32 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
2020
#include "usvfsconnector.h"
2121
#include "settings.h"
2222
#include <memory>
23+
#include <sstream>
24+
#include <iomanip>
2325
#include <QTemporaryFile>
2426
#include <QProgressDialog>
2527
#include <QDateTime>
2628
#include <QCoreApplication>
2729

2830
static const char SHMID[] = "mod_organizer_instance";
2931

30-
/*
31-
extern "C" DLLEXPORT BOOL WINAPI VirtualLinkFile(LPCWSTR source, LPCWSTR
32-
destination, BOOL failIfExists);
33-
extern "C" DLLEXPORT BOOL WINAPI VirtualLinkDirectoryStatic(LPCWSTR source,
34-
LPCWSTR destination, unsigned int flags);
35-
extern "C" DLLEXPORT BOOL WINAPI ConnectVFS(const usvfs::Parameters
36-
*parameters);
37-
extern "C" DLLEXPORT void WINAPI DisconnectVFS();
38-
extern "C" DLLEXPORT void WINAPI GetCurrentVFSName(char *buffer, size_t size);
39-
extern "C" DLLEXPORT BOOL WINAPI CreateProcessHooked(LPCWSTR lpApplicationName
40-
, LPWSTR lpCommandLine
41-
, LPSECURITY_ATTRIBUTES
42-
lpProcessAttributes
43-
, LPSECURITY_ATTRIBUTES
44-
lpThreadAttributes
45-
, BOOL bInheritHandles
46-
, DWORD dwCreationFlags
47-
, LPVOID lpEnvironment
48-
, LPCWSTR
49-
lpCurrentDirectory
50-
, LPSTARTUPINFOW
51-
lpStartupInfo
52-
, LPPROCESS_INFORMATION
53-
lpProcessInformation
54-
);
55-
extern "C" DLLEXPORT void __cdecl InitLogging(bool toLocal = false);
56-
extern "C" DLLEXPORT void __cdecl InitHooks(LPVOID userData, size_t
57-
userDataSize);
58-
*/
32+
33+
std::string to_hex(void *bufferIn, size_t bufferSize)
34+
{
35+
unsigned char *buffer = static_cast<unsigned char *>(bufferIn);
36+
std::ostringstream temp;
37+
temp << std::hex;
38+
for (size_t i = 0; i < bufferSize; ++i) {
39+
temp << std::setfill('0') << std::setw(2) << (unsigned int)buffer[i];
40+
if ((i % 16) == 15) {
41+
temp << "\n";
42+
} else {
43+
temp << " ";
44+
}
45+
}
46+
return temp.str();
47+
}
48+
5949

6050
LogWorker::LogWorker()
6151
: m_Buffer(1024, '\0')

0 commit comments

Comments
 (0)