<table><tr><td style="">meven added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D28745">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
          color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D28745#675033" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D28745#675033</a>, <a href="https://phabricator.kde.org/p/marcingu/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@marcingu</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><p>Ok, so, what I want to do now is to create static method <tt style="background: #ebebeb; font-size: 13px;">findByPath</tt> which is going to return Solid::StorageVolume instance (is there a case in which we can expect something different than StorageVolume?).</p></div>
</blockquote>

<p>I don't think so, Storage Volume is any block device.<br />
This function may fail if the input path is not valid for instance.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>Should it be <tt style="background: #ebebeb; font-size: 13px;">StorageVolume Device::findByPath(QString)</tt> or rather <tt style="background: #ebebeb; font-size: 13px;">StorageVolume StorageVolume::findByPath(QString)</tt>?</p></blockquote>

<p>My preference is <tt style="background: #ebebeb; font-size: 13px;">StorageVolume Device::findByPath(QString)</tt>, to keep all entry points to Solid in Device and somewhat similar to the <tt style="background: #ebebeb; font-size: 13px;">Device::listFrom*</tt> functions.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>For implementation itself I want to create structure with mountpoints and StorageVolumes which will be updated if new Device is added/removed and we learn this via Solid notifications.</p></blockquote>

<p>Yeah that's what I imagined as well, but this is already taken care of by the base DeviceManager.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>I am thinking it should either be part of <tt style="background: #ebebeb; font-size: 13px;">DeviceManagerStorage</tt> or separate class similar to DeviceManagerStorage. Not sure which.</p></blockquote>

<p>Either way you can simply wrap the base DeviceManager.<br />
Your method should only be a utility function not adding new Structures, everything is in Solid already.</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>I don't know how to get a mountpoint for StorageVolume.</p></blockquote>

<p>You make me realize you should filter StorageVolume (any block device) that are also StorageAccess (anything that can be mounted) which has the mountpoints in <tt style="background: #ebebeb; font-size: 13px;">filePath()</tt>.</p>

<p><a href="https://api.kde.org/frameworks/solid/html/classSolid_1_1StorageVolume.html" class="remarkup-link" target="_blank" rel="noreferrer">https://api.kde.org/frameworks/solid/html/classSolid_1_1StorageVolume.html</a> <br />
<a href="https://api.kde.org/frameworks/solid/html/classSolid_1_1StorageAccess.html" class="remarkup-link" target="_blank" rel="noreferrer">https://api.kde.org/frameworks/solid/html/classSolid_1_1StorageAccess.html</a></p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>What do you think about it?</p></blockquote>

<p>I like it</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R320 KIO Extras</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D28745">https://phabricator.kde.org/D28745</a></div></div><br /><div><strong>To: </strong>marcingu, ivan, broulik, Dolphin, ngraham, meven, bruns<br /><strong>Cc: </strong>thiago, bruns, meven, ngraham, kde-frameworks-devel, kfm-devel, waitquietly, azyx, nikolaik, pberestov, iasensio, aprcela, fprice, LeGast00n, cblack, fbampaloukas, alexde, Codezela, feverfew, michaelh, spoorun, navarromorales, firef, andrebarros, emmanuelp, rdieter, mikesomov<br /></div>