Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TanninOne committed May 6, 2016
1 parent e43762e commit 32480f7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 35 deletions.
1 change: 1 addition & 0 deletions src/editexecutablesdialog.cpp
Expand Up @@ -21,6 +21,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "ui_editexecutablesdialog.h"
#include "filedialogmemory.h"
#include "stackdata.h"
#include "modlist.h"
#include <QMessageBox>
#include <Shellapi.h>
#include <utility.h>
Expand Down
13 changes: 7 additions & 6 deletions src/mainwindow.cpp
Expand Up @@ -2978,11 +2978,7 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos)

if (info->getNexusID() > 0) {
menu->addAction(tr("Visit on Nexus"), this, SLOT(visitOnNexus_clicked()));
}

//If a URL is specified which is not the game's URL, pop up 'visit web page'
if (info->getURL() != "" &&
!NexusInterface::instance()->isModURL(info->getNexusID(), info->getURL())) {
} else if ((info->getURL() != "")) {
menu->addAction(tr("Visit web page"), this, SLOT(visitWebPage_clicked()));
}

Expand Down Expand Up @@ -3025,7 +3021,7 @@ void MainWindow::on_categoriesList_itemSelectionChanged()

m_ModListSortProxy->setCategoryFilter(categories);
m_ModListSortProxy->setContentFilter(content);
ui->clickBlankLabel->setEnabled(categories.size() > 0);
ui->clickBlankButton->setEnabled(categories.size() > 0);
if (indices.count() == 0) {
ui->currentCategoryLabel->setText(QString("(%1)").arg(tr("<All>")));
} else if (indices.count() > 1) {
Expand Down Expand Up @@ -4579,3 +4575,8 @@ void MainWindow::dropEvent(QDropEvent *event)
event->accept();
}


void MainWindow::on_clickBlankButton_clicked()
{
deselectFilters();
}
3 changes: 3 additions & 0 deletions src/mainwindow.h
Expand Up @@ -183,6 +183,9 @@ public slots:
virtual void dragEnterEvent(QDragEnterEvent *event);
virtual void dropEvent(QDropEvent *event);

private slots:
void on_clickBlankButton_clicked();

private:

void cleanup();
Expand Down
48 changes: 19 additions & 29 deletions src/usvfsconnector.cpp
Expand Up @@ -20,42 +20,32 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "usvfsconnector.h"
#include "settings.h"
#include <memory>
#include <sstream>
#include <iomanip>
#include <QTemporaryFile>
#include <QProgressDialog>
#include <QDateTime>
#include <QCoreApplication>

static const char SHMID[] = "mod_organizer_instance";

/*
extern "C" DLLEXPORT BOOL WINAPI VirtualLinkFile(LPCWSTR source, LPCWSTR
destination, BOOL failIfExists);
extern "C" DLLEXPORT BOOL WINAPI VirtualLinkDirectoryStatic(LPCWSTR source,
LPCWSTR destination, unsigned int flags);
extern "C" DLLEXPORT BOOL WINAPI ConnectVFS(const usvfs::Parameters
*parameters);
extern "C" DLLEXPORT void WINAPI DisconnectVFS();
extern "C" DLLEXPORT void WINAPI GetCurrentVFSName(char *buffer, size_t size);
extern "C" DLLEXPORT BOOL WINAPI CreateProcessHooked(LPCWSTR lpApplicationName
, LPWSTR lpCommandLine
, LPSECURITY_ATTRIBUTES
lpProcessAttributes
, LPSECURITY_ATTRIBUTES
lpThreadAttributes
, BOOL bInheritHandles
, DWORD dwCreationFlags
, LPVOID lpEnvironment
, LPCWSTR
lpCurrentDirectory
, LPSTARTUPINFOW
lpStartupInfo
, LPPROCESS_INFORMATION
lpProcessInformation
);
extern "C" DLLEXPORT void __cdecl InitLogging(bool toLocal = false);
extern "C" DLLEXPORT void __cdecl InitHooks(LPVOID userData, size_t
userDataSize);
*/

std::string to_hex(void *bufferIn, size_t bufferSize)
{
unsigned char *buffer = static_cast<unsigned char *>(bufferIn);
std::ostringstream temp;
temp << std::hex;
for (size_t i = 0; i < bufferSize; ++i) {
temp << std::setfill('0') << std::setw(2) << (unsigned int)buffer[i];
if ((i % 16) == 15) {
temp << "\n";
} else {
temp << " ";
}
}
return temp.str();
}


LogWorker::LogWorker()
: m_Buffer(1024, '\0')
Expand Down

0 comments on commit 32480f7

Please sign in to comment.